in reply to Re: deleting a particular character and its coresponding score in 2 different files!!!
in thread deleting a particular character and its coresponding score in 2 different files!!!
the result which i got is#!/usr/bin/perl use strict; use warnings; open(FH1,"read.txt"); open(FH2,"qual.txt"); my @arr1=<FH1>; my @arr2=<FH2>; my $joi1=join(' ',@arr1); my $joi2=join(' ',@arr2); my @new=split('>',$joi1); my @numbers=split('>',$joi2); my @new; my @seqid; foreach(@new){ my($seq_id,$seq)=split(/\n/,$_); push(@alp,split(' ',$seq)); push(@seqid,$seq_id); } my @numbers; my @numid; foreach(@numbers){ my ($num_id,$numb)=split(/\n/,$_); push(@num,split(' ',$numb)) +; push(@numid,$num_id) } my @keep= grep {$_ < 1 || $num[$_]>=10 || $alp[$_-1] ne $alp[$_-0]} 0. +.$#num; print (join(' ',@alp[@keep]),"\n"); print (join(' ',@num[@keep]),"\n");
Is this problem because i am using more than one string from 2 different files? in the above program, why are we not comparing the character repetition at all? In some cases, if the number is less than 10, but doesnt come into repeted continous characters, it should be removed. Please suggest what can be done. I am not very good at perl :-( ThanksUse of uninitialized value in split at sample.pl line 15,<FH2> line 6. Use of uninitialized value in split at sample.pl line 21,<FH2> line 6. Use of uninitialized value in string ne at sample.pl line 24, <FH2> li +ne 6. Use of uninitialized value in join or string at sample.pl line 25, <FH +2> line 6. TGACTTTTGCAAAGCTCGTA TGACTTTTGCAAAGCTCGTA TGACTTTTGCAAAGCTCGTA + 34 45 34 23 32 43 54 45 3 +4 12 23 45 54 65 34 23 54 42 34 45 34 23 32 43 54 45 34 12 23 45 54 6 +5 34 23 54 42 34 45 34 23 32 43 54 45 34 12 23 45 54 65 34 23 54 42
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: deleting a particular character and its coresponding score in 2 different files!!!
by GrandFather (Saint) on Oct 14, 2008 at 10:26 UTC | |
|
Re^3: deleting a particular character and its coresponding score in 2 different files!!!
by apl (Monsignor) on Oct 14, 2008 at 10:00 UTC |