Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

mail

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


sanjeetsanju at gmail

Jan 4, 2008, 11:03 PM

Post #1 of 7 (212 views)
Permalink
mail

hi all,
I am facing problem to fetch mail from internet mail server. Plz help
me, how can do this?



thanks ,
sanjeet
--
http://mail.python.org/mailman/listinfo/python-list


steve at REMOVE-THIS-cybersource

Jan 5, 2008, 12:01 AM

Post #2 of 7 (200 views)
Permalink
Re: mail [In reply to]

On Fri, 04 Jan 2008 23:03:15 -0800, sanjeet wrote:

> hi all,
> I am facing problem to fetch mail from internet mail server. Plz help
> me, how can do this?


Yes.

Everything you need to know to fix your problem can be found here:
www.catb.org/~esr/faqs/smart-questions.html


--
Steven
--
http://mail.python.org/mailman/listinfo/python-list


grante at visi

Jul 4, 2009, 12:15 PM

Post #3 of 7 (175 views)
Permalink
Re: mail [In reply to]

On 2009-07-04, amrita[at]iisermohali.ac.in <amrita[at]iisermohali.ac.in> wrote:

> I want to know that whether using python programming is it
> possible to extract chemical shift information about some
> amino acids of some protein from BMRB(BioMagResBank) or
> Ref-DB(referenced databank) or not.

Yes.

I don't know how easy it would be, but I'm pretty confident it
is possible.

I'm assuming it is currently possible to do so using some sort
of software. If it's currently impossible to do so using other
methods (e.g. such information doesn't exist or you don't have
access to the dabases), then using Python isn't going cause any
miracles to happen.

--
Grant

--
http://mail.python.org/mailman/listinfo/python-list


banibrata.dutta at gmail

Jul 5, 2009, 10:37 PM

Post #4 of 7 (157 views)
Permalink
Re: mail [In reply to]

On Sat, Jul 4, 2009 at 9:51 PM, <amrita[at]iisermohali.ac.in> wrote:

> Hi,
>
> I want to know that whether using python programming is it possible to
> extract chemical shift information about some amino acids of some protein
> from BMRB(BioMagResBank) or Ref-DB(referenced databank) or not.
>
> Thanks,
> Amrita Kumari
> Research Fellow
> IISER Mohali
> Chandigarh
> INDIA
>

Without any real knowledge of the problem domain, but with keyword level
google search, here's one one finds --
http://www.ccpn.ac.uk/api-documentation/ccpnmr/ccpnmr2.0/python/doc/api.html
<http://www.ccpn.ac.uk/api-documentation/ccpnmr/ccpnmr2.0/python/doc/api.html>
http://biopython.org/wiki/Main_Page
<http://biopython.org/wiki/Main_Page>http://chempython.org/
<http://chempython.org/>http://www.sschwarzer.net/

Also as Grant says, if you can create a software program in any language,
you can potentially do it with Python as well. As Python is a "batteries
included" language, chances are, the included-batteries would make your life
easier. Of course mileage may vary. If you find existing modules that do
much of what you want, you have a very good starting point.
--
regards,
Banibrata
http://www.linkedin.com/in/bdutta


invalid at invalid

Jul 15, 2009, 12:05 PM

Post #5 of 7 (142 views)
Permalink
Re: mail [In reply to]

On 2009-07-15, amrita[at]iisermohali.ac.in <amrita[at]iisermohali.ac.in> wrote:

> Sorry that I am disturbing you all again and again but this is the way I
> am trying to solve my problem:---

We could probably be a lot more helpful if you would keep these
postings all in a single thread so that people who didn't read
the first postings knew what you were talking about in
subsequent postings.


>>>> import re
>>>> exp = re.compile("CA")

> [...]
>
> file is something lookin like:-----
>
> 47 8 ALA H H 7.85 0.02 1

[...]

IMO you're making a mistake using the "re" module for this
task. I think you'd be a lot better off if you just used the
string type's split method to split each line up into fields
and processed the individual fields:

for line in inputfile:

field = line.split()

if field[2] == "CA":
<<do whatever with whichever fields you care about>>
elif field[2] == "soemthing-else"
<<do something else with some other fields>>

<<print results of doing whatever and something else above>>

--
Grant Edwards grante Yow! If I felt any more
at SOPHISTICATED I would DIE
visi.com of EMBARRASSMENT!
--
http://mail.python.org/mailman/listinfo/python-list


jcd at sdf

Jul 15, 2009, 12:40 PM

Post #6 of 7 (140 views)
Permalink
Re: mail [In reply to]

On Thu, 2009-07-16 at 00:16 +0530, amrita[at]iisermohali.ac.in wrote:
> Dear all,
>
> Sorry that I am disturbing you all again and again but this is the way I
> am trying to solve my problem:---
>
> >>> import re
> >>> exp = re.compile("CA")
> >>> infile = open("file1.txt")
> >>> for line in infile:
> ... values = re.split("\s+", line)
> ... if exp.search(line):
> ... print ("%s %s CA = %s" %(values[2], values[3], values[6]))
> ...
> with this it is giving the output like:----
>
> 8 ALA CA = 54.67
> 15 ALA CA = 52.18
> 21 ALA CA = 54.33
> 23 ALA CA = 55.84
> 33 ALA CA = 55.58
> 38 ALA CA = 54.33
>
> which is all right but i want CB and C value also in each row and it
> should take value from 5th column infront of them, file is something
> lookin like:-----
>
> 47 8 ALA H H 7.85 0.02 1
> 48 8 ALA HA H 2.98 0.02 1
> 49 8 ALA HB H 1.05 0.02 1
> 50 8 ALA C C 179.39 0.3 1
> 51 8 ALA CA C 54.67 0.3 1
> 52 8 ALA CB C 18.85 0.3 1
> 53 8 ALA N N 123.95 0.3 1
> 107 15 ALA H H 8.05 0.02 1
> 108 15 ALA HA H 4.52 0.02 1
> 109 15 ALA HB H 1.29 0.02 1
> 110 15 ALA C C 177.18 0.3 1
> 111 15 ALA CA C 52.18 0.3 1
> 112 15 ALA CB C 20.64 0.3 1
> 113 15 ALA N N 119.31 0.3 1
> 154 21 ALA H H 7.66 0.02 1
> 155 21 ALA HA H 4.05 0.02 1
> 156 21 ALA HB H 1.39 0.02 1
> 157 21 ALA C C 179.35 0.3 1
> 158 21 ALA CA C 54.33 0.3 1
> 159 21 ALA CB C 17.87 0.3 1
> 160 21 ALA N N 123.58 0.3 1
> 169 23 ALA H H 8.78 0.02 1
> 170 23 ALA HA H 4.14 0.02 1
> 171 23 ALA HB H 1.62 0.02 1
> 172 23 ALA C C 179.93 0.3 1
> 173 23 ALA CA C 55.84 0.3 1
> 174 23 ALA CB C 17.55 0.3 1
> 175 23 ALA N N 120.16 0.3 1
> 232 33 ALA H H 7.57 0.02 1
> 233 33 ALA HA H 3.89 0.02 1
> 234 33 ALA HB H 1.78 0.02 1
> 235 33 ALA C C 179.24 0.3 1
> 236 33 ALA CA C 55.58 0.3 1
> 237 33 ALA CB C 19.75 0.3 1
> 238 33 ALA N N 121.52 0.3 1
> 269 38 ALA H H 8.29 0.02 1
> 270 38 ALA HA H 4.04 0.02 1
> 271 38 ALA HB H 1.35 0.02 1
> 272 38 ALA C C 178.95 0.3 1
> 273 38 ALA CA C 54.33 0.3 1
> 274 38 ALA CB C 18.30 0.3 1
> 275 38 ALA N N 120.62 0.3 1
>
> I just want that it will give output something like:-----
>
> 8 ALA C = 179.39 CA = 54.67 CB = 18.85
> 15 ALA C = 177.18 CA = 52.18 CB = 20.64
> 21 ALA C = 179.35 CA = 54.33 CB = 17.87.....
>
> so first it will write the position of the amino acid(given by second
> column)then amino acid here it is ALA and then the corresponding value of
> C, CA and CB from 5th colum for each position of ALA.
>

Your program is structured wrong for doing what you want. Right now you
are essentially saying, "for each line in the input file, print
something", but each line of the input file only has part of the
information you want. Instead, you should create a data structure that
gathers the pieces you want, and only print once you have all of those
pieces in place.

Step one, create your data structure, so the data is grouped the way you
want it, not by line:

>>> thingies = {} # create a dictionary
>>> for line in infile:
>>> data = line.split()
>>>
>>> if data[1] not in thingies:
>>> # group data by data[1]
>>> thingies[data[1]] = {}
>>>
>>> thingies[data[1]][data[3]] = data[5]

Step two, extract the data from the list:

>>> for key, data in thingies.items():
>>> print key,
>>> for entry in data
>>> print '%s = %s' % (entry, data[entry]),

This should do what you want, minus some formatting issues.

Cheers,
Cliff


--
http://mail.python.org/mailman/listinfo/python-list


koranthala at gmail

Jul 15, 2009, 8:42 PM

Post #7 of 7 (134 views)
Permalink
Re: mail [In reply to]

On Jul 15, 11:46 pm, amr...@iisermohali.ac.in wrote:
> Dear all,
>
> Sorry that I am disturbing you all again and again but this is the way I
> am trying to solve my problem:---
>
> >>> import re
> >>> exp = re.compile("CA")
> >>> infile = open("file1.txt")
> >>> for line in infile:
>
> ...     values = re.split("\s+", line)
> ...     if exp.search(line):
> ...        print ("%s %s CA = %s" %(values[2], values[3], values[6]))
> ...
>  with this it is giving the output like:----
>
> 8 ALA CA = 54.67
> 15 ALA CA = 52.18
> 21 ALA CA = 54.33
> 23 ALA CA = 55.84
> 33 ALA CA = 55.58
> 38 ALA CA = 54.33
>
> which is all right but i want CB and C value also in each row and it
> should take value from 5th column infront of them, file is something
> lookin like:-----
>
>  47     8   ALA       H     H      7.85     0.02     1
>  48     8   ALA       HA    H      2.98     0.02     1
>  49     8   ALA       HB    H      1.05     0.02     1
>  50     8   ALA       C     C    179.39      0.3     1
>  51     8   ALA       CA    C     54.67      0.3     1
>  52     8   ALA       CB    C     18.85      0.3     1
>  53     8   ALA       N     N    123.95      0.3     1
> 107    15   ALA       H     H      8.05     0.02     1
> 108    15   ALA       HA    H      4.52     0.02     1
> 109    15   ALA       HB    H      1.29     0.02     1
> 110    15   ALA       C     C    177.18      0.3     1
> 111    15   ALA       CA    C     52.18      0.3     1
> 112    15   ALA       CB    C     20.64      0.3     1
> 113    15   ALA       N     N    119.31      0.3     1
> 154    21   ALA       H     H      7.66     0.02     1
> 155    21   ALA       HA    H      4.05     0.02     1
> 156    21   ALA       HB    H      1.39     0.02     1
> 157    21   ALA       C     C    179.35      0.3     1
> 158    21   ALA       CA    C     54.33      0.3     1
> 159    21   ALA       CB    C     17.87      0.3     1
> 160    21   ALA       N     N    123.58      0.3     1
> 169    23   ALA       H     H      8.78     0.02     1
> 170    23   ALA       HA    H      4.14     0.02     1
> 171    23   ALA       HB    H      1.62     0.02     1
> 172    23   ALA       C     C    179.93      0.3     1
> 173    23   ALA       CA    C     55.84      0.3     1
> 174    23   ALA       CB    C     17.55      0.3     1
> 175    23   ALA       N     N    120.16      0.3     1
> 232    33   ALA       H     H      7.57     0.02     1
> 233    33   ALA       HA    H      3.89     0.02     1
> 234    33   ALA       HB    H      1.78     0.02     1
> 235    33   ALA       C     C    179.24      0.3     1
> 236    33   ALA       CA    C     55.58      0.3     1
> 237    33   ALA       CB    C     19.75      0.3     1
> 238    33   ALA       N     N    121.52      0.3     1
> 269    38   ALA       H     H      8.29     0.02     1
> 270    38   ALA       HA    H      4.04     0.02     1
> 271    38   ALA       HB    H      1.35     0.02     1
> 272    38   ALA       C     C    178.95      0.3     1
> 273    38   ALA       CA    C     54.33      0.3     1
> 274    38   ALA       CB    C     18.30      0.3     1
> 275    38   ALA       N     N    120.62      0.3     1
>
> I just want that it will give output something like:-----
>
> 8  ALA  C = 179.39  CA = 54.67  CB = 18.85
> 15 ALA  C = 177.18  CA = 52.18  CB = 20.64
> 21 ALA  C = 179.35  CA = 54.33  CB = 17.87.....
>
> so first it will write the position of the amino acid(given by second
> column)then amino acid here it is ALA and then the corresponding value of
> C, CA and CB from 5th colum for each position of ALA.
>
> Amrita Kumari
> Research Fellow
> IISER Mohali
> Chandigarh
> INDIA

Hi,
Can you try using the code which I suggested in the earlier thread?
If you cannot use it to get the output, just point it out here, and
I will try to solve the issue.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.