Skip to content

Commit

Permalink
Main (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
NavandarM committed May 27, 2024
2 parents 9f11e76 + 75f002c commit c764d85
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- rich-click >=1.5
- biopython >=1.7
- bbmap >= 38.98
- multiqc >= 1.12
- multiqc >= 1.21
- fastqc >= 0.11.9
- kraken2 >= 2.1.2
- blast >= 2.13.0
Expand Down
12 changes: 9 additions & 3 deletions src/dissectBCL/fakeNews.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,23 +527,29 @@ def shipFiles(outPath, config):
'Illumina_{}'.format(yrstr),
outLane
)
logging.info(f"Using {seqFacDir} to populate samba dir.")
if not os.path.exists(seqFacDir):
pathlib.Path(
seqFacDir
).mkdir(parents=True, exist_ok=True)
for qcRepo in glob.glob(
os.path.join(outPath, 'Project_*', 'multiqc_report.html')
):
_mqcreports = glob.glob(
os.path.join(outPath, '*', '*multiqc_report.html')
)
if not _mqcreports:
logging.warning(f"No multiqcreports found under {outLane}")
for qcRepo in _mqcreports:
# to seqfacdir
outqcRepo = os.path.join(
seqFacDir, qcRepo.split('/')[-2] + '_multiqcreport.html'
)
logging.info(f"Copying {qcRepo} over to {outqcRepo}")
shutil.copyfile(qcRepo, outqcRepo)
# to bioinfoCoredir
outqcBioinfo = os.path.join(
config['Dirs']['bioinfoCoreDir'],
qcRepo.split('/')[-2] + '_multiqcreport.html'
)
logging.info(f"Copying {qcRepo} over to {outqcBioinfo}")
shutil.copyfile(qcRepo, outqcBioinfo)
transferStop = datetime.datetime.now()
transferTime = transferStop - transferStart
Expand Down
22 changes: 21 additions & 1 deletion src/dissectBCL/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from importlib.metadata import version
import sys
import logging
import shutil


def getConf(configfile, quickload=False):
Expand Down Expand Up @@ -338,6 +337,9 @@ def formatMisMatches(mmDic):
return (retStr[:-2])


'''
Uncomment the shutil
def fetchLatestSeqDir(PIpath, seqDir):
# fetch sorted sequence_data directories ascending
seqDirs = sorted(
Expand All @@ -357,6 +359,24 @@ def fetchLatestSeqDir(PIpath, seqDir):
"No seq_data dir for {} found with space. Exiting.".format(PIpath)
)
sys.exit()
'''


def fetchLatestSeqDir(PIpath, seqDir):
'''
Fetch the latest sequencing_data dir in the PI directory
'''
seqDirNum = 0
for dirs in os.listdir(os.path.join(PIpath)):
if seqDir in dirs:
seqDirStrip = dirs.replace('sequencing_data', '')
if seqDirStrip != '':
if int(seqDirStrip) > seqDirNum:
seqDirNum = int(seqDirStrip)
if seqDirNum == 0:
return os.path.join(PIpath + '/sequencing_data')
else:
return os.path.join(PIpath + '/sequencing_data' + str(seqDirNum))


def umlautDestroyer(germanWord):
Expand Down

0 comments on commit c764d85

Please sign in to comment.