This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seqtk

Hello guys, Apricot has 8 chromosomes but I wanna get just 1 chromosome instead of others using Seqtk tool. Could you pls help me with this issue? Which code Can I use for it?

seqtk

What assembly are you using? You should link to it if possible or provide the names of the fasta headers with grep "^>" file.fasta

1 answer

use samtools faidx instead, First index the genome

samtools faidx genome.fa

then extract the chromosome of interest

samtools faidx genome.fa chrom1 > subset.fa

Thank you. for your reply. My file is "Prunus_armeniaca_Stella.fasta.gz" it is not "fa" . I tried it but I couldn't get any result

You need first to extract the FASTA file from the archive.

gzip --decompress --stdout Prunus_armeniaca_Stella.fasta.gz >Prunus_armeniaca_Stella.fasta

samtools faidx Prunus_armeniaca_Stella.fasta title_of_the_chromosome_you_need >one_chromosome.fasta

Hello shelkmike, I tried the codes, it works but I run this code : samtools faidx Prunus_armeniaca_Stella.fasta >one_chromosome.fasta. I got two different files one them is Prunus_armeniaca_Stella.fasta.fai the other one is one_chromosome.fasta. But I have a problem with one_chromosome.fasta. It shows zero byte. Do I have any missing code?

I figure it out guys thank you so much for all of your help

Log in to answer this question.