Perl: the Markov chain saw | |
PerlMonks |
Re^2: string manipulation with Regexby FluffyBunny (Acolyte) |
on Sep 01, 2010 at 20:19 UTC ( [id://858408]=note: print w/replies, xml ) | Need Help?? |
Dear CountZero and other senior Perlmonks who replied to my post: This is basically what I am trying to do: you have a text file with string like this CGAATTAATGGGAATTG and you have your reference sequence saying CGAATTAAGGAATTG note your input has two letters inserted, which are TG So you will get CIGAR ID from your alignment program saying 8M2I7M To help you understand visually (so originally no blank), I manually aligned these two string variables. CGAATTAATGGGAATTG CGAATTAA GGAATTG So using this I would like to keep the same original letter position for inputs... that is why I have to compare input string variables to reference string variables to make them have the same letter position (basically insertions are useless) For deletions, I have the exact opposite situation.. so lets flip my first example's situation This case it will be 8M2D7M CGAATTAA GGAATTG <--- my input for 2nd example (the gap is again intentionally made) CGAATTAATGGGAATTG <--- my output for 2nd example you see I am missing two letters and I need some letter holders to keep the input's letter positions the same compared to the reference.. so I want to fill two X's CGAATTAAXXGGAATTG <--- same length, other letter positions will be the same I also posted the link which leads to the original post that I had with a different problem (already fixed) there you can find my input files. Thank you for your help
In Section
Seekers of Perl Wisdom
|
|