Skip to content

Commit

Permalink
now possible to run bed files in csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
arontommi committed Jan 12, 2018
1 parent 3fc6a0b commit 01926ed
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
56 changes: 29 additions & 27 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions smallerbams/smallerbam.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ def __init__(self):

def runbams(self, bamfile, region, outputfile):
"""run samtools view"""
if str(region).endswith('.bed'):
region = '-L ' + region
else:
pass
sp.call(['{}'.format(self.bashscript),
'{}'.format(bamfile),
'{}'.format(region),
'{}'.format(outputfile)])

def runmultiple(self, csv):
file = pd.read_csv(csv, header=None)
for i, r in file.iterrows():
Expand Down

0 comments on commit 01926ed

Please sign in to comment.