A file is

ELLPSYSTATL
ELLSUYSTLTL
* * * : . * * * :* *
HHULJKLOPOA
HPULJKLPOOA
* . * * * * * : : * *
and it is a long file .....

so output shud be
where there is : and . counting start from E and end upto A.

P4S
S5U
A9L
H13P
O19P
P20O

Recommended Answers

All 5 Replies

Hey There,

Not sure what you're looking for based on the output and then the results.

Are these colons and dots in the text? And, the case of P4S, what context are you using to count from E to A?

If you could clarify, that would be great. I'm not really sure what you're trying to accomplish.

Thanks,

Mike

Thanx ...
See this simple file
ABCDEFG
ABCEEFH
* * * : * * * .
so it have three rows . Those first two rows say
A and A match then it will be * (asterisk) in the third row.
and those D and E not match there will be colon (: ) or
G and H not match .(fullstop) in the third row

Our question is
In third row where there is colon (: ) and .(fullstop)
tell the number and wht is that name at that number
therefore output will be
D4E because colon is at 4 number
G7H because fullstop is at 7 number

And it will be a long file where there is colon and full stop
just tell the number and name ...

One more question is
In some other files colon or fullstop may be at 4th row or 5th row
can u script this one also separately

Hey There,

Are there always only 2 mismatched letters in each pair of rows? Just wondering if you do multiple colons before full stop and how you handle that.

Also, can you post what you have so far? Just curious as to where you're having the issue.

Thanks :)

, Mike

Hey There,

Are there always only 2 mismatched letters in each pair of rows? Just wondering if you do multiple colons before full stop and how you handle that.

Also, can you post what you have so far? Just curious as to where you're having the issue.

Thanks :)

, Mike

Thanks for looking into the question
Actually u can say this is a part of sequence alignment ( biology) where amino acids of one sequence aligns with amino acids of another sequence Say between human and chimpanzee
so those amino aicid match thatwill give asterisk
otherwise colon or fullstop ( this is by software program which can produce that)
.

can u produce a script if u look into the question previously posted if possible.

Thanks

Sorry, I know awk/sed was requested, but a python solution was so easy, couldn't help to post it:

#!python

(a, b) = ([], [])
(i,j)=(1,1)
diffchar=['.',':']

for line in open("sq.txt"):
        line=line.strip()
        if i == 1:
                a = list(line)
        elif i == 2:
                b = list(line)
        elif i == 3:
                for (x,k) in enumerate(list(line.replace(' ',''))):
                        if (k in diffchar):
                                print a[x]+str(j)+b[x]
                        j+=1

                i=0
        i+=1

Discard if you can't have Python. This may give you some idea about the awk code though (feel too lazy to translate in awk:)

HTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.