I would like to extract a single contig from a fasta file, and I have many fasta files and contigs I need to do this with. Note the fasta files have different names and the contigs have different names for each scenario. I know I can use seqtk with a list, but building a list for each assembly is a pain because there are so many, and I am only looking to pull one contig from each assembly. Does anyone know of an easy way to do this (without having to make a separate list of 1 contig for each assembly). I just want to name the single contig in the code. Any help is appreciated!
Question: extract single contig from fasta file based on name?
25 days ago by
goatsrunfaster • 20
goatsrunfaster • 20 wrote:
ADD COMMENT • link •
22 days ago by
harishk0201 • 70
harishk0201 • 70 wrote:
The easiest way is to do the following, but ofcourse as ATpoint points out, we don't know how your contig headers look, so that may be an issue. The easiest way is however below:
printf "contigid\n" | seqtk subseq contigs.fasta - > contigid.fasta
ADD COMMENT • link
Please log in to add an answer.
Powered by Biostar version 2.3.0
Traffic: 749 users visited in the last hour