I have a sting of "0"s and "1"s that I need to analyze. I need to look at each "1" and determine if it is in a neighborhood that is enriched for "1"s which means it is one of at least three "1"s in a 4 character window. My desired output is a count of "1"s in an enriched area.
For Example
Input sequence= 0100101000111011010111000
Output = 9
SO far my code looks like the following:
It works just fine but problems include:
1) that, most importantly, it is slow as a snail.
2) it misses the first 3 characters of the string and the last three. I could live with this if necessary as long as the rest of the code works more quickly.
Any and all suggestions are welcome. Please understand that I am still new to this and description of what suggested code is doing is really, really useful.
Last edited by monstrousturtle; 05-14-2012 at 03:18 PM..
Reason: clarity of the code
Hi Unix Gurus,
I have a file with data like:
>header_1
TCCCCGA
>header_2
CCAATTGGGTA
The data to work with starts from the next line after '>header_xx'.
(1)
I want to search the three letter patterns 'CHH' or 'DDG' and replace C and G by exclamation ! so that CHH becomes !HH and DDG... (3 Replies)
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
I'm doing a little work that involves computing the average completion time of the last 5 of many file decompressions. It's not too tough, but I'm wondering if maybe there's a better way to write it. This is a bash script; here's the current idea:
ctime5=$ctime4
ctime4=$ctime3
ctime3=$ctime2... (2 Replies)
Hello
Could you help with small script:
How to split string X1 into 3 string
String X1 can have 1 or many strings
X1='A1:B1:C1:D1:A2:B2:C2:D2:A3:B3:C3:D3'
This is output which I want to have:
Z1='A1:B1:C1:D1'
Z2='A2:B2:C2:D2'
Z3='A3:B3:C3:D3' (5 Replies)
I want to do the next
"I don't want to go school
because I'm sick today."
I want to join these two line but only when the first line is not more than 20 characters
and ended whit nothing or a comma and the second line not more than 15.
The 20 and the 15 can be change in the script.
I know... (10 Replies)
Very simple problem I am not able to solve. I have been trying to modify the following code:
awk '{t=$1; c = x}{for (i = 1; i <= length; i += wn)print t FS"" substr($2, i, mx) > ("block" ++c)}' mx=100 wn=100 infile.txt
What I am tryng to acccomplish, I have a bunch of files where the first... (3 Replies)
Hi!
I have some sequencing data that I have aligned using maq software
Now, I have data that looks like this each line is a 'tag'
chr1 10001
chr1 10002
chr1 10005
chr1 10007
chr1 10008
chr1 10008
chr1 10008
chr1 10019
chr1 10019
chr1 10020
What I really want to find out is how... (1 Reply)
First of all I am VERY new to this so bare with me and try and explain everything even if it seems simple.
Basically I want to read a line of text from a html file. See if the line of text has a certain string in it. copy an unknown number of characters (the last 4 characters wiil be ".jpg" the... (1 Reply)
I am doing some training for a job I have just got and there is an exercise I am stuck with. I am not posting to ask a question about logic, just a trivial help with string manipulation. I would appreciate if somebody could at least give me a hint on how to do it.
Basically, the intelligent part... (8 Replies)