Skip to content

Commit 0ebd1f2

Browse files
committed
Modified generate_weblogo. Added weblogo 3 support
1 parent 23df4a4 commit 0ebd1f2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

haystack/external.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1207,19 +1207,24 @@ def pwm_from_meme_file(meme_filename,motif_id):
12071207
return pwm
12081208

12091209

1210-
def generate_weblogo(motif_id,meme_filename,output_filename,file_format='PNG',title=None,scale=2.0):
1210+
def generate_weblogo(motif_id,meme_filename,output_filename,file_format='png',title=None):
1211+
1212+
if title==None: title = output_filename
1213+
1214+
output_filename = output_filename + '.' + file_format
12111215

12121216
pwm=pwm_from_meme_file(meme_filename,motif_id)
12131217
meme_motif=Motif_from_counts(pwm)
12141218

12151219
kmers = meme_motif.bogus_kmers(100)
1216-
width = float(len(kmers[0]) ) *scale
1220+
#width = float(len(kmers[0]) ) *scale
12171221
#height = float(4)
12181222
#width, height = width*scale, height*scale
12191223
tmp = tempfile.mktemp() + '.fsa'
1220-
if title==None: title = output_filename
12211224
seqs2fasta(kmers,tmp)
1222-
cmd = 'weblogo -F %s --errorbars NO --fineprint "" --upper %d -A dna -f %s -o %s -t "%s" '%(file_format,width, tmp, output_filename, title)
1225+
1226+
tmp= "/home/rick/cap.fa"
1227+
cmd = 'weblogo -F %s -A dna -f %s -o %s -t "%s" --errorbars NO --fineprint "" '%(file_format, tmp, output_filename, title)
12231228
#print cmd
12241229
sb.call(cmd,shell=True)
12251230

0 commit comments

Comments
 (0)