commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/af58b5faffec/ changeset: af58b5faffec user: John Duddy date: 2011-11-29 00:37:37 summary: Add merge method to SAM datatype so BWA can do split/merge affected #: 1 file diff -r 5db0da0007fcc59bb23f0e0ae2edb1e961702f14 -r af58b5faffec3b6715850e6d50b7bef69a5bbef5 lib/galaxy/datatypes/tabular.py --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -352,6 +352,22 @@ dataset.metadata.comment_lines = comment_lines dataset.metadata.columns = 12 dataset.metadata.column_types = ['str', 'int', 'str', 'int', 'int', 'str', 'str', 'int', 'int', 'str', 'str', 'str'] +355,369d354 + def merge( split_files, output_file): + """ + Multiple SAM files may each have headers. Since the headers should all be the same, remove + the headers from files 1-n, keeping them in the first file only + """ + cmd = 'mv %s %s' % ( split_files[0], output_file ) + result = os.system(cmd) + if result != 0: + raise Exception('Result %s from %s' % (result, cmd)) + if len(split_files) > 1: + cmd = 'egrep -v "^@" %s >> %s' % ( ' '.join(split_files[1:]), output_file ) + result = os.system(cmd) + if result != 0: + raise Exception('Result %s from %s' % (result, cmd)) + merge = staticmethod(merge) class Pileup( Tabular ): """Tab delimited data in pileup (6- or 10-column) format""" https://bitbucket.org/galaxy/galaxy-central/changeset/8993f7342095/ changeset: 8993f7342095 user: dannon date: 2011-12-06 14:43:32 summary: Pull in jdlogicman's SAM merge. affected #: 1 file diff -r 43326a266e8eb5818c695c235df82a025a3b6893 -r 8993f7342095d3fac1feb3458ecee909ba678e11 lib/galaxy/datatypes/tabular.py --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -353,6 +353,22 @@ dataset.metadata.columns = 12 dataset.metadata.column_types = ['str', 'int', 'str', 'int', 'int', 'str', 'str', 'int', 'int', 'str', 'str', 'str'] + def merge( split_files, output_file): + """ + Multiple SAM files may each have headers. Since the headers should all be the same, remove + the headers from files 1-n, keeping them in the first file only + """ + cmd = 'mv %s %s' % ( split_files[0], output_file ) + result = os.system(cmd) + if result != 0: + raise Exception('Result %s from %s' % (result, cmd)) + if len(split_files) > 1: + cmd = 'egrep -v "^@" %s >> %s' % ( ' '.join(split_files[1:]), output_file ) + result = os.system(cmd) + if result != 0: + raise Exception('Result %s from %s' % (result, cmd)) + merge = staticmethod(merge) + class Pileup( Tabular ): """Tab delimited data in pileup (6- or 10-column) format""" file_ext = "pileup" Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket