Hi,
I'm having trouble with this task:
Write a perl script that will generate a new output file (“task1 output.txt”) which contains the sequence name, length, and GC-content for each sequence. There should be a header line which identifies the contents of columns (so the first line in the output file should be “SeqName Length GC-Content” or something similar). The GC-content of a sequence is defined as the percentage of bases that are G or C (from 0% to 100%), and a high GCcontent is associated with coding sequences.
>Seq1 ACGT
Then your output file should look like:
SeqName Length GC-Content Seq1 4 50
I can do the in and out for the file handles, but I'm confused as to what to put in my while loop. And how will it know to match in the file?
You need to show the code so we can see the issues you are having. We can tell you what to do but that probably won't help much.
{{
for thewhile
body?tr
operation?to count the length of each sequence ?
You're using a
tr
operation to count length? Why?what do you suggest ?
The
length()
function sounds appropriate here.thanks alot, all for your help i got it.
i thought the double {{ is necessary for multiple tasks within the loop ?
Who says so? That makes no sense in any programming language.
thank you Ill remove it, Im learning as I go here.