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

Hi, I try to extract sequences from a fastq file using the "subseq" in seqtk. But the extract file contains only the 1st sequence but no others. I am wondering whether my name.lst file does not fit with what seqtk needs. I have names of each sequence without other symbols each line in the name.lst. But the fastq file starts each sequence name with a @. Should I add @ in front of each sequence name? Or what other problem it can be?

Any suggestion is welcome. Thanks,

Chih-Ming

4 answers

Looks like this reply might be coming in a bit too late, but here goes:

a. Like @Istvan says, the sequence with the ID might not exist in the FASTA file

b. The ID might contain a white space, in which case the characters after the white space are processed as sequence description and not as sequence ID.

c. Duplicate ID maybe?

Seems to work fine below (also test out fine with fastq files). Make sure that you are requesting the ids that actually exist.

ialbert@porthos ~
$ cat test.fa 
>x1
AAAAAA
>x2
TTTTTT
>x3
CCCCCC
>x4
GGGGGG

ialbert@porthos ~
$ cat name.list 
x2
x4


ialbert@porthos ~
$ seqtk subseq test.fa name.list 
>x2
TTTTTT
>x4
GGGGGG

I am having the following issue with seqtk:

I know I have the following header in both my mate pairs:

$ grep -A 1 "SN618:644:H2WH2BCXY:2:2208:4695:74911" forward_paired.fq

@SN618:644:H2WH2BCXY:2:2208:4695:74911 1:N:0:CGTACTAG+GCGTAAGA
CATGAGCTCTCCTCCGTTTCTCTGTAATCTTCCCATATACCGGATGATAATTATGTATATTTTAACATGGACCCTGAAAATCTTCAACGAAAAACGCCGG

 

$ grep -A 1 "SN618:644:H2WH2BCXY:2:2208:4695:74911" reverse_paired.fq

@SN618:644:H2WH2BCXY:2:2208:4695:74911 2:N:0:CGTACTAG+GCGTAAGA
ATCATGGACCGTGTAGGCGGCGGTGATTCCTTTGCTTCCGGACTGATCTACGGTCTTATGACTACAGGAAATGCAGAAACTGCGGTGAATTACGGTGCTG

I have this header in my header list file:

$ cat seqtk.debug

SN618:644:H2WH2BCXY:2:2208:4695:74911

When I run seqtk on both my mate pairs, I only get output for one of my mate pairs. What would be the issue ?

$ seqtk subseq forward_paired.fq seqtk.debug

$ seqtk subseq reverse_paired.fq seqtk.debug 
@SN618:644:H2WH2BCXY:2:2208:4695:74911
ATCATGGACCGTGTAGGCGGCGGTGATTCCTTTGCTTCCGGACTGATCTACGGTCTTATGACTACAGGAAATGCAGAAACTGCGGTGAATTACGGTGCTG
+
DDDBDIHHIIIGHHHIFHIIIHGEDHIIIIIIGHHIIIIIIFHIFHIHHIHHIHHHHIIHGHHHHGHHEHHEEHGHHHHIEHHIIHI?GHH1FHGHEDHI

I'd recommend asking a new question and including a link to relevant posts (in this case, the top-level post here). That way, you're letting people know you did some digging but you still have a question.

Adding your question as an answer to a different question, especially to a 4 year old question doesn't seem like the best way to go about it.

@ Ram: Thanks for the edits !

I found that it was a formatting issue with my fastq file. Seqtk works fine.

Thanks, Ajay.

Please move this to a comment on your post above. Do not add answers unless you're answering the top-level question. Steps to move your answer:

  • Copy the contents of your reply from this answer (you can edit this answer and do a Select All -> Copy)
  • Click on Add Comment on your post here: A: Problem Of Using Subseq In Seqtk
  • Paste the copied text
  • Click on the green Add Comment button
  • Click on moderate back in your answer here: A: Problem Of Using Subseq In Seqtk
  • Choose Delete Post
  • Click on the blue Submit button.

Thank you!

Log in to answer this question.