How to extract sequences from fasta that have a certain length ?
1
0
Entering edit mode
3.6 years ago

lets say that I have a fasta file which have reads with different sizes and I want to create a new fasta that have reads with lengths ranging from 50bp to 100bp is there any tool for doing this? I checked this one:

https://bioinformaticsreview.com/20200728/extract-fasta-sequences-based-on-sequence-length-using-perl/?unapproved=848&moderation-hash=3b17a078f5852674e7f10c913b8561a6#comment-848

but I got an error message ):

readline() on unopened filehandle at extractfasta.pl line 7

this is the command that I used:

perl extractfasta.pl /path-to/BAC4A_L00M_R1_001.fasta 50 100 > 100_maxln.fasta
minlength fasta • 3.7k views
ADD COMMENT
2
0
Entering edit mode

THanks so much for your answer, what I need is to make a new fasta that have sequences that have a length range between 50-100. those links are aproached to filter a fasta rather than extracting sequences by length

ADD REPLY
0
Entering edit mode

That is fine. People can find these solutions via search in future in one spot.

ADD REPLY
0
Entering edit mode
seqkit seq -m 50 -M 100 /path-to/BAC4A_L00M_R1_001.fasta > 100_maxln.fasta
ADD REPLY

Login before adding your answer.

Traffic: 1160 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6