Question: (Closed) Quality trimming fastq
0
gravatar for uruboro
14 months ago by
uruboro0
uruboro0 wrote:

Request of help for quality trimming of a fastq file I cannot understand how to develop it

fastq • 679 views
ADD COMMENTlink modified 14 months ago • written 14 months ago by uruboro0

As this is an assignment (thank you for disclosing), don't expect direct answers, but we can nudge you into the right direction.

The snippet of code you posted makes no sense. Post your code on pastebin or github gist, then we can help. Here are two tips:

1) perl by default reads files one line at a time (not true, but you can ignore this for now, it is mostly true).

2) fastq files are organized in sets of four lines.

Use these two facts to correctly assign $header, $dna and $qual.

ADD REPLYlink written 14 months ago by h.mon23k

Thank you for your reply! I modified my question adding the program I wrote.

This is one of the two versions I made. The first one differs only for how I open the fastq file (I used $file = shift at the beginning). However of the two versions, this one I posted is one that "sounds better" to me (I don't know how to explain it).

ADD REPLYlink modified 14 months ago • written 14 months ago by uruboro0

uruboro : Once you ask a question/post your code you should not remove either of those things. Doing so makes this thread orphan. Now @h.mon's answer has no reference.

ADD REPLYlink modified 14 months ago • written 14 months ago by genomax62k

I'm a new student of bioinformatics and I'm learning Perl for the first time.

I realize choice of language is a matter of personal preference, but I'd strongly suggest not going for Perl. The language has been absolutely wonderful for bioinformatics and quite some (legacy) software is written in Perl. It's obviously a powerful language with nice options. But you would be so much better off if you would go for Python (or R).

But perhaps your homework requires you to use Perl. Time to riot.

ADD REPLYlink written 14 months ago by WouterDeCoster36k

Thank you for your reply!

unfortunately I have to use Perl as it is an assignment...

ADD REPLYlink written 14 months ago by uruboro0

Hello uruboro!

Note: I am going to close this question until you restore your code/details that the original post had. Once you restore the details the thread will be re-opened.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

ADD REPLYlink modified 14 months ago • written 14 months ago by genomax62k
1
gravatar for h.mon
14 months ago by
h.mon23k
Brazil
h.mon23k wrote:

Honestly, there are a lot of issues with your script.

I would suggest you use strict; in addition to use warnings; (or perl -w as you are doing, but if I remember correctly the PERL docs recommend use warnings; instead) and use diagnose;.

Line 16 ( if(open(FASTQ,"<fosmid1.fastq")) ) is useless as you would have died if couldn't open FASTQ in line 6 ( open FASTQ, "<fosmid1.fastq" or die $!; ).

It is not incorrect per se to use <STDIN>, but I would prefer to read $kmer and $cut_off from @ARGV.

The following snippet does not work as you expect, see what I wrote above, and read some tutorial on reading files, e.g. this one.

while($header1 = <FASTQ>)
{ 
        $dna = <FASTQ>;
        $header1 = <FASTQ>;
        $qual = <FASTQ>;
}

As the values being entered into the variables are not what you think they are, there is no point at this moment to comment further on your script. First make sure your are assigning the correct values to $header, $dna and $qual, then you should proceed further. Use print "$header"; etc to debug your code.

ADD COMMENTlink written 14 months ago by h.mon23k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1323 users visited in the last hour