Skip to content

Commit

Permalink
Merge pull request #6 from jfear/biosample_des
Browse files Browse the repository at this point in the history
Biosample des
  • Loading branch information
jfear committed May 18, 2017
2 parents c4ffa25 + 986d7cf commit bc3b21c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions sramongo/biosample.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self, node):
'tax_id': ('Description/Organism', 'taxonomy_id'),
'tax_name': ('Description/Organism', 'taxonomy_name'),
'organism_name': ('Description/Organism/OrganismName', 'text'),
'description': ('Description/Comment/Paragraph', 'text'),
'institute': ('Owner/Name', 'text'),
'access': ('.', 'access'),
'biosample_accn': ('.', 'accession'),
Expand Down
4 changes: 4 additions & 0 deletions sramongo/mongo_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ class BioSample(EmbeddedDocument):
title: mongoengine.StringField
A free text description of the sample.
description: mongoengine.StringField
A free text description of the sample.
tax_id: mongoengine.StringField
The tax_id that the sample belongs.
Expand Down Expand Up @@ -900,6 +903,7 @@ class BioSample(EmbeddedDocument):
sample_id = StringField()
GEO = StringField()
title = StringField()
description = StringField()
tax_id = StringField()
tax_name = StringField()
organism_name = StringField()
Expand Down
12 changes: 6 additions & 6 deletions sramongo/sra2mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def arguments():
args = parser.parse_args()

if args.host and (args.dbDir or args.logDir):
logger.warn('Both --host and --dbpath/--logDir were provided; going to try using running mongo server.')
logger.warning('Both --host and --dbpath/--logDir were provided; going to try using running mongo server.')

if not (args.host or args.dbDir or args.logDir):
logger.warn('You must provide either a `--host hostname` with a running database or '
logger.warning('You must provide either a `--host hostname` with a running database or '
'`--dbpath <path to db> --logDir <path to log>`')

return args
Expand Down Expand Up @@ -222,17 +222,17 @@ def fetch_sra(records, cache, runinfo_retmode='text', **kwargs):

except HTTPError as err:
if (500 <= err.code <= 599) & (attempt < 3):
logger.warn("Received error from server %s" % err)
logger.warn("Attempt %i of 3" % attempt)
logger.warning("Received error from server %s" % err)
logger.warning("Attempt %i of 3" % attempt)
time.sleep(15)
else:
logger.error("Received error from server %s" % err)
logger.error("Please re-run command latter.")
sys.exit(1)
except IncompleteRead as err:
if attempt < 3:
logger.warn("Received error from server %s" % err)
logger.warn("Attempt %i of 3" % attempt)
logger.warning("Received error from server %s" % err)
logger.warning("Attempt %i of 3" % attempt)
time.sleep(15)
else:
logger.error("Received error from server %s" % err)
Expand Down
3 changes: 3 additions & 0 deletions sramongo/sra_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

LIBRARY_STRATEGY = [
"AMPLICON",
"ATAC-seq",
"Bisulfite-Seq",
"ChIP-Seq",
"CLONE",
Expand All @@ -32,6 +33,7 @@
"FAIRE-seq",
"FINISHING",
"FL-cDNA",
"HI-C",
"MBD-Seq",
"MeDIP-Seq",
"miRNA-Seq",
Expand Down Expand Up @@ -151,6 +153,7 @@
"Illumina HiSeq X Ten",
"Illumina MiSeq",
"Illumina MiniSeq",
"Illumina NextSeq 500",
"Ion Torrent PGM",
"Ion Torrent Proton",
"NextSeq 500",
Expand Down

0 comments on commit bc3b21c

Please sign in to comment.