(base) dell@dell-server:~/test$ ls -lhtr
总用量 904K
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 query.fastq
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 target_db.fastq
(base) dell@dell-server:~/test$ makeblastdb -in target_db.fasta -dbtype nucl -parse_seqids -out target_database
Building a new DB, current time: 05/18/2022 17:48:33
New DB name: /home/dell/test/target_database
New DB title: target_db.fasta
Sequence type: Nucleotide
Keep Linkouts: T
Keep MBits: T
Maximum file size: 1000000000B
Adding sequences from FASTA; added 500 sequences in 0.0449848 seconds.
(base) dell@dell-server:~/test$ ls -lhtr
总用量 1.1M
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 query.fasta
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 target_db.fasta
-rw-rw-r-- 1 dell dell 109K 5月 18 17:48 target_database.nsq
-rw-rw-r-- 1 dell dell 849 5月 18 17:48 target_database.nsi
-rw-rw-r-- 1 dell dell 42K 5月 18 17:48 target_database.nsd
-rw-rw-r-- 1 dell dell 2.0K 5月 18 17:48 target_database.nog
-rw-rw-r-- 1 dell dell 6.0K 5月 18 17:48 target_database.nin
-rw-rw-r-- 1 dell dell 37K 5月 18 17:48 target_database.nhr
这是未转化为gff格式之前的比对结果
(base) dell@dell-server:~/test$ blastn -db target_database -query query.fasta -outfmt 6 | head
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_031808.1;ATP6;LEN=684 100.00 684 0 0 1 684 1 684 0.0 1264
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_036746.1;ATP6;LEN=684 89.62 684 71 0 1 684 1 684 0.0 870
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_002079.1;ATP6;LEN=684 86.99 684 89 0 1 684 1 684 0.0 771
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_036383.1;ATP6;LEN=684 85.67 684 98 0 1 684 1 684 0.0 721
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_045918.1;ATP6;LEN=684 85.38 684 100 0 1 684 1 684 0.0 710
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_031813.1;ATP6;LEN=684 81.95 687 118 5 1 684 1 684 5e-166 577
animal_mito;NC_031808.1;ATP6;LEN=684 animal_mito;NC_027953.1;ATP6;LEN=684 76.56 687 155 6 1 684 1 684 2e-104 372
animal_mito;NC_004299.1;ATP6;LEN=684 animal_mito;NC_004299.1;ATP6;LEN=684 100.00 684 0 0 1 684 1 684 0.0 1264
animal_mito;NC_004299.1;ATP6;LEN=684 animal_mito;NC_011632.1;ATP6;LEN=683 94.57 681 35 2 1 680 1 680 0.0 1051
animal_mito;NC_045918.1;ATP6;LEN=684 animal_mito;NC_045918.1;ATP6;LEN=684 100.00 684 0 0 1 684 1 684 0.0 1264
这是转化为gff格式之后的比对结果
(base) dell@dell-server:~/test$ blastn -db target_database -query query.fasta -outfmt 6 | awk -v OFS="\t" '{ if ($10 > $9) print $2, "tblastn", "match", $9, $10, $12, "+", ".", "ID="$1; else print $2, "tblastn", "match", $10, $9, $12, "-", ".", "ID="$1 }' | head
animal_mito;NC_031808.1;ATP6;LEN=684 tblastn match 1 684 1264 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_036746.1;ATP6;LEN=684 tblastn match 1 684 870 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_002079.1;ATP6;LEN=684 tblastn match 1 684 771 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_036383.1;ATP6;LEN=684 tblastn match 1 684 721 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_045918.1;ATP6;LEN=684 tblastn match 1 684 710 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_031813.1;ATP6;LEN=684 tblastn match 1 684 577 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_027953.1;ATP6;LEN=684 tblastn match 1 684 372 + . ID=animal_mito;NC_031808.1;ATP6;LEN=684
animal_mito;NC_004299.1;ATP6;LEN=684 tblastn match 1 684 1264 + . ID=animal_mito;NC_004299.1;ATP6;LEN=684
animal_mito;NC_011632.1;ATP6;LEN=683 tblastn match 1 680 1051 + . ID=animal_mito;NC_004299.1;ATP6;LEN=684
animal_mito;NC_045918.1;ATP6;LEN=684 tblastn match 1 684 1264 + . ID=animal_mito;NC_045918.1;ATP6;LEN=684
最后输出gff格式输出结果
(base) dell@dell-server:~/test$ blastn -db target_database -query query.fasta -outfmt 6 | awk -v OFS="\t" '{ if ($10 > $9) print $2, "tblastn", "match", $9, $10, $12, "+", ".", "ID="$1; else print $2, "tblastn", "match", $10, $9, $12, "-", ".", "ID="$1 }' > blastn_result.gff
(base) dell@dell-server:~/test$ ls -lhtr
总用量 1.4M
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 query.fasta
-rw-rw-r-- 1 dell dell 450K 5月 18 17:45 target_db.fasta
-rw-rw-r-- 1 dell dell 109K 5月 18 17:48 target_database.nsq
-rw-rw-r-- 1 dell dell 849 5月 18 17:48 target_database.nsi
-rw-rw-r-- 1 dell dell 42K 5月 18 17:48 target_database.nsd
-rw-rw-r-- 1 dell dell 2.0K 5月 18 17:48 target_database.nog
-rw-rw-r-- 1 dell dell 6.0K 5月 18 17:48 target_database.nin
-rw-rw-r-- 1 dell dell 37K 5月 18 17:48 target_database.nhr
-rw-rw-r-- 1 dell dell 226K 5月 18 17:54 blastn_result.gff
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。