Skip to content
Snippets Groups Projects
Commit 8c326b3f authored by Vermaat's avatar Vermaat
Browse files

Fix mapview import preprocessing

parent 7a692f14
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ For example, to import transcript mappings for the GRCh37 assembly, run the ...@@ -63,7 +63,7 @@ For example, to import transcript mappings for the GRCh37 assembly, run the
following:: following::
$ wget ftp://ftp.ncbi.nih.gov/genomes/H_sapiens/ARCHIVE/BUILD.37.2/mapview/seq_gene.md.gz $ wget ftp://ftp.ncbi.nih.gov/genomes/H_sapiens/ARCHIVE/BUILD.37.2/mapview/seq_gene.md.gz
$ zcat seq_gene.md.gz | sort -k 11,11 -k 2,2 > seq_gene.sorted.md $ zcat seq_gene.md.gz | sort -t $'\t' -k 11,11 -k 2,2 > seq_gene.sorted.md
$ mutalyzer-admin assemblies import-mapview seq_gene.sorted.md 'GRCh37.p2-Primary Assembly' $ mutalyzer-admin assemblies import-mapview seq_gene.sorted.md 'GRCh37.p2-Primary Assembly'
.. note:: The last argument, ``GRCh37.p2-Primary Assembly``, defines the group .. note:: The last argument, ``GRCh37.p2-Primary Assembly``, defines the group
......
...@@ -217,7 +217,7 @@ def main(): ...@@ -217,7 +217,7 @@ def main():
description=import_mapview.__doc__.split('\n\n')[0], description=import_mapview.__doc__.split('\n\n')[0],
epilog='Note: We require that FILE is sorted on the `feature_id` ' epilog='Note: We require that FILE is sorted on the `feature_id` '
'(#11) and `chromosome` (#2) columns. This can be done with a ' '(#11) and `chromosome` (#2) columns. This can be done with a '
'`sort -k 11,11 -k 2,2` command.') '`sort -t $\'\\t\' -k 11,11 -k 2,2` command.')
p.set_defaults(func=import_mapview) p.set_defaults(func=import_mapview)
p.add_argument( p.add_argument(
'mapview_file', metavar='FILE', type=argparse.FileType('r'), 'mapview_file', metavar='FILE', type=argparse.FileType('r'),
......
...@@ -886,7 +886,7 @@ def import_from_mapview_file(assembly, mapview_file, group_label): ...@@ -886,7 +886,7 @@ def import_from_mapview_file(assembly, mapview_file, group_label):
(#11), which always contains the gene identifier, and then on the (#11), which always contains the gene identifier, and then on the
`chromosome` column (#2). `chromosome` column (#2).
sort -k 11,11 -k 2,2 seq_gene.md > seq_gene.by_gene.md sort -t $'\t' -k 11,11 -k 2,2 seq_gene.md > seq_gene.by_gene.md
Raises :exc:`ValueError` if `mapview_file` is not sorted this way. Raises :exc:`ValueError` if `mapview_file` is not sorted this way.
...@@ -1004,7 +1004,7 @@ def import_from_mapview_file(assembly, mapview_file, group_label): ...@@ -1004,7 +1004,7 @@ def import_from_mapview_file(assembly, mapview_file, group_label):
processed_keys = set() processed_keys = set()
for key, records in groupby(read_records(mapview_file), for key, records in groupby(read_records(mapview_file),
itemgetter('feature_id', 'chromosome')): itemgetter('feature_id', 'chromosome')):
if key in processed_keys: if key in processed_keys:
raise MapviewSortError('Mapview file must be sorted by feature_id ' raise MapviewSortError('Mapview file must be sorted by feature_id '
'and chromosome (try `sort -k 11,11 -k ' 'and chromosome (try `sort -k 11,11 -k '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment