errors: PS: The code is already written, dont ant you to write the code...just get me rid of the errors....my program s done, just wanna get rid of the errors listed below...I am sure u can help me wit that and it is not just processing the sequences ,I am done wit that..it has to calculate their masses(Ive written a code for that too just wanna get rid of the errors).....Just mentioned in detail so that I can give u a clear picture of what is happening.. 1)Use of uninitialised value in split at line 56,58,60,62,64,66. 2)Use of uninitialised value$peptide,£missed,$type,$enzymes,$sequences in line 71. 3)Task is In this task you should read in a standard Fasta format file and convert the sequence information into masses, or strictly speaking, mass-to-charge values. You will find the masses of the standard amino acids to 4 decimal places here (http://www.matrixscience.com/help/aa_help.html). The program should cope with both monoisotopic and average masses, and should calculate the mass-to- charge value as if they were all ions of +1 charge (Hence, you need to add 1 to all values, for 1 proton). You also need to add the mass of water to the mass of the summed amino acid values, as these are for a single residue, so you need to add the masses of the terminating groups (e.g. H at the N-terminus and OH at the C-terminus). These values are: 18.0106 for monoisotopic masses, and 18.0153 for average masses. Your output should be something of the form.: >Mass(A):18.0153|Charge:1|>Protein: HEMINF_F3_Complement_N160_S1099133_L163 |Peptide:1|Mass(A):1853.9346|Charge:1|Missed:0|Terminal:N|Enzyme:trypsin|sequence: MPSFDIVSEITLHEVR >Protein: HEMINF_F3_Complement_N160_S1099133_L163 |Peptide:2|Mass(A):868.415|Charge:1|Missed:0|Terminal:I|Enzyme:trypsin|sequence:NAVENANR >Protein: HEMINF_F3_Complement_N160_S1099133_L163 |Peptide:3|Mass(A):556.3333|Charge:1|Missed:0|Terminal:I|Enzyme:trypsin|sequence:VLSTR >Protein: HEMINF_F3_Complement_N160_S1099133_L163 |Peptide:4|Mass(A):581.2597|Charge:1|Missed:0|Terminal:I|Enzyme:trypsin|sequence:YDFR >Protein: HEMINF_F3_Complement_N160_S1099133_L163 |Peptide:5|Mass(A):1181.6293|Charge:1|Missed:0|Terminal:I|Enzyme:trypsin|sequence:GVEAVIELNEK
#!/usr/bin/perl -w # use strict; use warnings; # useful hashes for converting one letter code to mass # my %s2m = (A => 71.0371, C => 103.0092, D => 115.0269, E => 129.0426, F => 147.0684, G => 57.0215, H => 137.0589, I => 113.0841, K => 128.0950, L => 113.0841, M => 131.0405, N => 114.0429, P => 97.0528, Q => 128.0586, R => 156.1011, S => 87.0320, T => 101.0477, V => 99.0684, W => 186.0793, Y => 163.0633, '\s' => 0.0, "*" => 0.0 ); my %s2a = (A => 71.08, C => 103.14, D => 115.09, E => 129.12, F => 147.18, G => 57.05, H => 137.14, I => 113.16, K => 128.17, L => 113.16, M => 131.19, N => 114.10, P => 97.12, Q => 128.13, R => 156.19, S => 87.08, T => 101.10, V => 99.13, W => 186.21, Y => 163.18, '\s' => 0.0, "*" => 0.0 ); my $file = "P1GroupCExercise2_trypsin.txt"; my $header = ""; my %sequences = (); printf ">Mass(A):18.0153|Charge:1|"; # # open file # open(FILE,$file) or die "error: unable to open file $file\n"; while ( <FILE> ) { # # read in sequences in fasta format # next if /^\s*$/; # ignore blank lines if ( /^>((\S+)$)/ ) { $header = $1; } else { # assume its sequences chomp; $sequences{$header} .= $_ . ";"; } } close(FILE); while ((my $key, my $value) = each %sequences) { my @e = split(/;/, $value); # loop my @headers= split(/:/, $key); foreach $value (@e) { my @elements= split(/\|/, $value); $key = $headers[1]; # peptide = first element of @elements # missed = 2nd element of @elements # sequence = 5th element of @elements my @peptides= split (/:/, $elements[1]);#56 my $peptide = $peptides[1]; my @missedc = split (/:/, $elements[2]);#58 my $missed = $missedc[1]; my @typec=split (/:/, $elements[3]);#60 my $type=$typec[1]; my @enzymes=split (/:/, $elements[4]);#62 my $enzyme=$enzymes[1]; my @s= split(/:/, $elements[5]);#64 my $sequence= $s[1]; @peptides = split (//, $sequence);#66 my $total = 0.0; foreach my $peptide (@peptides) { $total += $s2m{$peptide} if defined $s2m{$peptide}; } my $output = ">Protein: $headers[1]\n|Peptide:$peptide|Mass(A +):$total|Charge:1|Missed:$missed|Terminal:$type|Enzyme:$enzyme|sequen +ce:$sequence\n";#71 print $output; } } <DATA(the format of the input file is something as displayed below)> >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:13|Missed:0|Type:I|Enzyme:trypsin|Seq:R| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:14|Missed:0|Type:I|Enzyme:trypsin|Seq:SK| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:15|Missed:0|Type:I|Enzyme:trypsin|Seq:NWALR| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:16|Missed:0|Type:I|Enzyme:trypsin|Seq:R| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:17|Missed:0|Type:I|Enzyme:trypsin|Seq:ER| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:18|Missed:0|Type:I|Enzyme:trypsin|Seq:VSIFFWLLSAAAIPTMIINR| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:19|Missed:0|Type:I|Enzyme:trypsin|Seq:GTSGAVIIK| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:20|Missed:0|Type:I|Enzyme:trypsin|Seq:IKPAAQFK| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:21|Missed:0|Type:I|Enzyme:trypsin|Seq:GNTAMK| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:22|Missed:0|Type:I|Enzyme:trypsin|Seq:ITTGTMAER| >Protein:HEMINF_F3_Complement_N182_S1226717_L118 |Peptide:23|Missed:0|Type:C|Enzyme:trypsin|Seq:LC|
In reply to perl task... by huzefa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |