Skip to content

Commit

Permalink
more nextstrain edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed May 7, 2020
1 parent c1d776e commit 26b2bb2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 17 additions & 1 deletion notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,28 @@ NucleotidePseudoGenesTotal
NucleotiderRNAs
AssemblySubmissionDate
SRARunPublishDate
BioSampleComment

```
# General
./sqlite_NextStrain_tsv.py --database ../results/ncbimeta_db/update/latest/output/database/yersinia_pestis_db.sqlite --query "SELECT BioSampleAccession,AssemblyFTPGenbank,SRARunAccession,BioSampleStrain,BioSampleCollectionDate,BioSampleHost,BioSampleGeographicLocation,BioSampleBiovar,PubmedArticleTitle,PubmedAuthorsLastName,AssemblyContigCount,AssemblyTotalLength,NucleotideGenes,NucleotideGenesTotal,NucleotidePseudoGenes,NucleotidePseudoGenesTotal,NucleotiderRNAs,AssemblySubmissionDate,SRARunPublishDate,BioSampleComment FROM Master" --output metadata_all_nextstrain.tsv
# Both Assembly and SRA
SELECT BioSampleAccession,AssemblyFTPGenbank,SRARunAccession,BioSampleStrain,BioSampleCollectionDate,BioSampleHost,BioSampleGeographicLocation,BioSampleBiovar,PubmedArticleTitle,PubmedAuthorsLastName,AssemblyContigCount,AssemblyTotalLength,NucleotideGenes,NucleotideGenesTotal,NucleotidePseudoGenes,NucleotidePseudoGenesTotal,NucleotiderRNAs,AssemblySubmissionDate,SRARunPublishDate,BioSampleComment FROM Master WHERE BioSampleComment NOT LIKE '%REMOVE%'
# Only Assembly
./sqlite_NextStrain_tsv.py --database ../results/ncbimeta_db/update/latest/output/database/yersinia_pestis_db.sqlite --query "SELECT BioSampleAccession,AssemblyFTPGenbank,SRARunAccession,BioSampleStrain,BioSampleCollectionDate,BioSampleHost,BioSampleGeographicLocation,BioSampleBiovar,PubmedArticleTitle,PubmedAuthorsLastName,AssemblyContigCount,AssemblyTotalLength,NucleotideGenes,NucleotideGenesTotal,NucleotidePseudoGenes,NucleotidePseudoGenesTotal,NucleotiderRNAs,AssemblySubmissionDate,SRARunPublishDate,BioSampleComment FROM Master WHERE (BioSampleComment NOT LIKE '%REMOVE%' AND TRIM(AssemblyFTPGenbank) > '')" --output metadata_assembly_nextstrain.tsv
We need to add the mandatory column sample/name
```


SELECT BioSampleAccession,AssemblyFTPGenbank,SRARunAccession,BioSampleStrain,BioSampleCollectionDate,BioSampleHost,BioSampleGeographicLocation,BioSampleBiovar,PubmedArticleTitle,PubmedAuthorsLastName,AssemblyContigCount,AssemblyTotalLength,NucleotideGenes,NucleotideGenesTotal,NucleotidePseudoGenes,NucleotidePseudoGenesTotal,NucleotiderRNAs,AssemblySubmissionDate,SRARunPublishDate FROM Master WHERE BioSampleComment NOT LIKE '%REMOVE%'

## NCBI Filtering by Attribute AHA!!!
```
"geo_loc_name=Russia: Chechnya"[attr]
"project_name=Rise of the Bronze Age"[attr]
```

## NextStrain setup
Expand Down
6 changes: 0 additions & 6 deletions scripts/sqlite_NextStrain_tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,13 @@
dest = 'outPath',
required = True)

parser.add_argument('--split-col',
help = 'Names of the column to check for splitting records (CSV).',
action = 'store',
dest = 'splitCol',
required = False)

# Retrieve user parameters
args = vars(parser.parse_args())

db_path = args['dbPath']
sql_query = args['sqlQuery']
out_path = args['outPath']
split_col = args['splitCol']

#------------------------------------------------------------------------------#
# Error Catching #
Expand Down

0 comments on commit 26b2bb2

Please sign in to comment.