Commit 594c5761 by Mustafa Tekpinar

Moved getNbSeq function from gemmeAnal.py to sgemme.py.

parent 7b3f2711
...@@ -42,17 +42,17 @@ import numpy as np ...@@ -42,17 +42,17 @@ import numpy as np
# return prot,seq,i-1 # return prot,seq,i-1
def getNbSeq(filename): # def getNbSeq(filename):
#TODO: Remove bash dependency and count the sequences within Python! # #TODO: Remove bash dependency and count the sequences within Python!
""" # """
# Get the number of sequences in a multi-fasta file # # Get the number of sequences in a multi-fasta file
""" # """
if filename!='': # if filename!='':
proc=subprocess.Popen("grep -c '^>' "+filename,stdout=subprocess.PIPE,shell=True) # proc=subprocess.Popen("grep -c '^>' "+filename,stdout=subprocess.PIPE,shell=True)
return int(proc.stdout.read()) # return int(proc.stdout.read())
else: # else:
return 0 # return 0
def createPDB(prot,seq): def createPDB(prot,seq):
""" """
......
...@@ -47,6 +47,18 @@ def extractQuerySeq(filename): ...@@ -47,6 +47,18 @@ def extractQuerySeq(filename):
i = i + 1 i = i + 1
fOUT.close() fOUT.close()
return prot,seq,i-1 return prot,seq,i-1
def getNbSeq(filename):
#TODO: Remove bash dependency and count the sequences within Python!
"""
# Get the number of sequences in a multi-fasta file
"""
if filename!='':
proc=subprocess.Popen("grep -c '^>' "+filename,stdout=subprocess.PIPE,shell=True)
return int(proc.stdout.read())
else:
return 0
############################################################################### ###############################################################################
def rankSortProteinData(dataArray, inverted=True): def rankSortProteinData(dataArray, inverted=True):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment