Mercurial > repos > peterjc > venn_list
comparison tools/plotting/venn_list.py @ 4:29fcd027d67a draft
Uploaded v0.0.6 take 1, simple test (which currently fails)
author | peterjc |
---|---|
date | Thu, 16 May 2013 12:43:57 -0400 |
parents | aefc86eda5f6 |
children |
comparison
equal
deleted
inserted
replaced
3:bacb7dfa846c | 4:29fcd027d67a |
---|---|
3 | 3 |
4 This script is copyright 2010 by Peter Cock, The James Hutton Institute | 4 This script is copyright 2010 by Peter Cock, The James Hutton Institute |
5 (formerly SCRI), UK. All rights reserved. | 5 (formerly SCRI), UK. All rights reserved. |
6 See accompanying text file for licence details (MIT/BSD style). | 6 See accompanying text file for licence details (MIT/BSD style). |
7 | 7 |
8 This is version 0.0.3 of the script. | 8 This is version 0.0.4 of the script. |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 import sys | 12 import sys |
13 import rpy | 13 import rpy |
44 print "Doing %i-way Venn Diagram" % n | 44 print "Doing %i-way Venn Diagram" % n |
45 | 45 |
46 def load_ids(filename, filetype): | 46 def load_ids(filename, filetype): |
47 if filetype=="tabular": | 47 if filetype=="tabular": |
48 for line in open(filename): | 48 for line in open(filename): |
49 if not line.startswith("#"): | 49 line = line.rstrip("\n") |
50 yield line.rstrip("\n").split("\t",1)[0] | 50 if line and not line.startswith("#"): |
51 yield line.split("\t",1)[0] | |
51 elif filetype=="fasta": | 52 elif filetype=="fasta": |
52 for line in open(filename): | 53 for line in open(filename): |
53 if line.startswith(">"): | 54 if line.startswith(">"): |
54 yield line[1:].rstrip("\n").split(None,1)[0] | 55 yield line[1:].rstrip("\n").split(None,1)[0] |
55 elif filetype.startswith("fastq"): | 56 elif filetype.startswith("fastq"): |