How to use samtools to intercept the sequence of specified position
This article introduces the relevant knowledge of "how to use samtools to intercept the sequence of a specified location". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Samtools faidx can create a file with the suffix .fai for the fasta sequence. According to this .fai file and the original fastsa file, it can quickly extract the sequence of any region.
Usage:
Samtools faidx input.fa
This command has certain requirements for the input fasta sequence: for each sequence, except for the last line, the length of other lines must be the same.
> one ATGCATGCATGCATGCATGCATGCATGCAT GCATGCATGCATGCATGCATGCATGCATGC ATGCAT > two another chromosome ATGCATGCATGCATGCATGCATGCATGC
The final generated .fai file is as follows, with 5 columns, separated by\ t
One 66 5 30 31two 28 98 14 15
The first column NAME: the name of the sequence, leaving only the contents after ">" and before the first blank.
The second column LENGTH: the length of the sequence in bp
The third column OFFSET: the offset of the first base, counted from 0, and the newline character also counted.
The fourth column LINEBASES: except for the last line, the base number of rows representing the sequence, in bp
The fifth column, LINEWIDTH: line width, except the last line, represents the length of the line of the sequence, including the newline character, which is\ r\ n in the windows system. Add 2 to the length of the sequence.
Extraction sequence:
Samtools faidx input.fa chr1 > chr1.fasamtools faidx input.fa chr1:100-200 > chr1.fa "how to use samtools to intercept the sequence of a specified location" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!