lh3 / seqtk

Toolkit for processing sequences in FASTA/Q formats
MIT License
1.37k stars 308 forks source link

nothing in .fa file when converting fastq to fasta #113

Closed climbandseq closed 6 years ago

climbandseq commented 6 years ago

Hello, I am very (!) new to working with sequencing files as well as Linux command line.

I used the command seqtk seq -a test.fq.gz > out.fa to try to convert a fastq file to fasta. I created the out.fa file but there is nothing in it. I also tried seqtk seq -A test.fq.gz > out.fa but with the same result.

I am sure it is something simple. I get no errors, and a .fa file is created, but there is nothing in the file. Thanks for your help!

tseemann commented 6 years ago

The command seqtk seq -A file.fq.gz > out.fa looks correct.

Maybe you file.fq.gz is empty? What does gzip -c -d file.fq.gz | head -n 4 say?

What version are you using?

seqtk 2>&1 | grep Version
Version: 1.2-r94
climbandseq commented 6 years ago

Thanks for the response! I am using Version: 1.0-r31. I am running it on Ubuntu in Windows 10 bash shell. I just installed all of that yesterday. I have a single fastq file on my Desktop called test.fq (but it says it is test.fq.gz in Properties). First, I ran this command: cd /mnt/c/Users/"sequencer PC"/Desktop Then I ran: seqtk seq -A test.fq.gz > out.fa That puts an empty file on my Desktop called out.fa. The test.fq.gz file has content, as I can open it in FastQC and see the quality etc. When I run gzip -c -d file.fq.gz | head -n 4 I get this message: "gzip: test.fq.gz: No such file or directory". Thanks for your help!!

evolgenomology commented 6 years ago

Try committing the .gz ending.

On 3 May 2018 at 15:52:51, climbandseq (notifications@github.com) wrote:

.gz

climbandseq commented 6 years ago

Thanks guys! I think I figured it out, though. When I created the test.fq.gz file, I copied one of my fastq files out of another folder and renamed it to make it simple. This morning I tried the following commands to see if maybe renaming the file was a problem. I did the following: cd /mnt/c/Users/"sequencer PC"/Documents/Location/Run1/Fastq seqtk seq -A 2_S1_L001_R1_001.fastq.gz > out.fa And it worked! I got my fasta file with content. Not sure if renaming the file had something to do with that.

Is there a single command to convert every fastq file in that folder to fasta? For example, can I say: seqtk seq -A *.fastq.gz > out.fa
Or something similar to convert all files in that folder that end in fastq.gz to fasta.

Thanks for your help! Not sure if renaming the file caused the problem.

evolgenomology commented 6 years ago

Great you got it sorted.

Look at for loops to do it for every file in your folder.

On 3 May 2018 at 17:45:31, climbandseq (notifications@github.com) wrote:

Thanks guys! I think I figured it out, though. When I created the test.fq.gz file, I copied one of my fastq files out of another folder and renamed it to make it simple. This morning I tried the following commands to see if maybe renaming the file was a problem. I did the following: cd /mnt/c/Users/"sequencer PC"/Documents/Location/Run1/Fastq seqtk seq -A 2_S1_L001_R1_001.fastq.gz > out.fa And it worked! I got my fasta file with content. Not sure if renaming the file had something to do with that.

Is there a single command to convert every fastq file in that folder to fasta? For example, can I say: seqtk seq -A *.fastq.gz > out.fa Or something similar to convert all files in that folder that end in fastq.gz to fasta.

Thanks for your help! Not sure if renaming the file caused the problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lh3/seqtk/issues/113#issuecomment-386360188, or mute the thread https://github.com/notifications/unsubscribe-auth/ACEWbi14v3JKuvojrZWHZXnNQ6SzUG8Hks5tuzQrgaJpZM4Tv_jr .

tseemann commented 6 years ago

@climbandseq can you close this issue now please? thanks!

climbandseq commented 6 years ago

Thanks for your help guys!