new user needs help!
Steve Holden
steve at holdenweb.com
Tue Apr 8 16:38:06 EDT 2008
drjekil wrote:
> I am totally new in biopython and its my first program.so may be i am asking
> stupid question.
New? Most questions are sensible.
Let's suppose that the four lines you give below are stored in a text
file called "/tmp/data.txt".
> I am working with a text filelooks like this:
> #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD
> 1lghB A i 79.8 H H -24.58
> 1lghB V i 79.6 H H -22.06
> 1lghB H i 71.9 H H -19.94
f = open("/tmp/data.txt", 'w')
will open that file.
You can throw the first line away with
headings = f.next()
Then you can loop over the rest with
for name, aa, topo, access, dssp, stride, z in file:
#
# Then process each line here
#
if 10.0 <= z <= 22.0:
#
# select on other criteria here
#
> i need to compare those lines which has a Z-COORED value between 10 to 22
> and presents in the following way
> True/false A C D E F G H I K L M N P Q R S T V X Y W(here alfabets
> represents amino acids)
> 1 1:1 2:0 3:0 and so on for rest of the amino acids.
> IF PRESENT IN THAT RANGE
> IF not PRESENT IN THAT RANGE then
> -1 1:0 2:0 so on,it should be 1 instead of 0 when it will find corresponding
> amino acid for that line.say here,for 2nd line it will be 16:1.
> true will represent 1,false -1.
I am afraid I am having trouble understanding that last bit. Perhaps you
could find some other way to say the same thing? Sometimes my
understanding is not too good.
> i have to cheek all the lins in the file and print it.
> u have to tell simply otherwise i cant understand even,so stupid am i!
"Poor at English" != "Stupid"
> I will be really greatful!Thanks in advance
That's the first step. Now, what's next?
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list