in reply to Re: string manipulation with Regex
in thread string manipulation with Regex
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: string manipulation with Regex
by Marshall (Canon) on Sep 01, 2010 at 22:48 UTC | |
by FluffyBunny (Acolyte) on Sep 02, 2010 at 15:24 UTC | |
by Marshall (Canon) on Sep 02, 2010 at 15:48 UTC | |
by bluecompassrose (Initiate) on Sep 02, 2010 at 16:06 UTC | |
Re^3: string manipulation with Regex
by CountZero (Bishop) on Sep 01, 2010 at 21:45 UTC | |
by FluffyBunny (Acolyte) on Sep 02, 2010 at 15:19 UTC |