Skip to content

Commit

Permalink
Contam emails (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
WardDeb authored Jan 10, 2024
2 parents 1687cbc + 3ebb982 commit 5a1cd78
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGES
=======

* actual seq\_data dir in email
* mycoplasma include in prep
* include mycoplasma hyorhinis
* auto version for docs, fix readthedocs yaml
* update changelog
* include authors
* make sure doc pytest includes reqs from the doc folder
* init readthedocs yaml, split up doc requirements
Expand Down
5 changes: 5 additions & 0 deletions contaminome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ prokaryotes:
vulgarname: mycoplasma
accession: GCF_003385765.1
taxid: 2148
Mesomycoplasma hyorhinis:
URL: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/383/515/GCF_000383515.1_ASM38351v1/GCF_000383515.1_ASM38351v1_genomic.fna.gz
vulgarname: mycoplasma-hyorhinis
accession: GCF000383515.1
taxid: 2100
Haemophilus influenzae:
URL: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/931/575/GCF_000931575.1_ASM93157v1/GCF_000931575.1_ASM93157v1_genomic.fna.gz
vulgarname: haemophilus
Expand Down
29 changes: 24 additions & 5 deletions src/tools/emailProjectFinished.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from dissectBCL.misc import getConf
from email.mime.text import MIMEText
import glob


def fetchFirstNameAndEmail(lastName, config):
Expand Down Expand Up @@ -55,15 +56,30 @@ def fetchFirstNameAndEmail(lastName, config):
return d[lastName]


def getProjectIDs(projects):
def getProjectIDs(projects, config):
IDs = []
for p in projects:
# Sanity check
assert (p.startswith("Project_"))
IDs.append(p.split("_")[1])
PI = p.split("_")[-1].lower()
# Get the actual sequencing_data dir
# Assume if multiple projects are given, they all in the same flowcell.
flowcell = getFlowCell()
# Assume that only a flow cell exists only once.
seqdir = glob.glob(
os.path.join(
config['Dirs']['piDir'],
PI,
config['Internals']['seqDir'] + '*',
flowcell
)
)[0].split('/')[-2]

if len(IDs) == 1:
return IDs[0]
return " and ".join([", ".join(IDs[:-1]), IDs[-1]])
return IDs[0], seqdir

return " and ".join([", ".join(IDs[:-1]), IDs[-1]]), seqdir


def getFlowCell():
Expand Down Expand Up @@ -168,8 +184,11 @@ def main():
if len(args.project) > 1:
content += "s"
content += (" {} are finished and the results are now available in your "
"group's sequencing data directory"
.format(getProjectIDs(args.project)))
"group's {} directory"
.format(
getProjectIDs(args.project, config)[0],
getProjectIDs(args.project, config)[1])
)

content += " under the {} folder.\n".format(getFlowCell())

Expand Down
1 change: 1 addition & 0 deletions src/tools/prep_contaminome.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'pseudomonas-putidia': [1211579, 12, 'species'],
'pseudomonas-fulva': [47880, 12, 'species'],
'mycoplasma': [2148, 14, 'species'],
'mycoplasma-hyorhinis': [2100, 14, 'species'],
'haemophilus': [727, 14, 'species'],
'sars-cov2': [2697049, 7, 'species'],
'flu-a': [335341, 7, 'species'],
Expand Down

0 comments on commit 5a1cd78

Please sign in to comment.