Skip to content

Commit

Permalink
Main (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
WardDeb authored Aug 4, 2023
2 parents e2faafe + 5514b2b commit e181c4e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
32 changes: 29 additions & 3 deletions src/dissectBCL/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,15 @@ def parseSS(self, parkourDF):
# ssdf = ssdf.dropna(axis=1, how='all')

ssdf = ssdf.astype({'Lane': 'int32'})
# Remove spaces if we have them
sp_clean = ssdf['Sample_Project'].apply(lambda x: umlautDestroyer(x))
ssdf['Sample_Project'] = sp_clean
# Sanitize projects names
ssdf['Sample_Project'] = ssdf['Sample_Project'].apply(
lambda x: umlautDestroyer(x)
)
# Sanitize sample names
ssdf['Sample_Name'] = ssdf['Sample_Name'].apply(
lambda x: umlautDestroyer(x)
)

self.fullSS = ssdf
self.laneSplitStatus = self.decideSplit()
ssDic = {}
Expand All @@ -280,6 +286,26 @@ def parseSS(self, parkourDF):
'Sample_Project',
]
)
if '-' in self.flowcell:
'''
In case of miSeq runs,
assume the requested depth is 20/#samples
this is due to the 10M / sample
minimum for parkour requests
we do this here (and not in pullparkour)
since parkour returns all
samples, not necesarily those sequenced.
'''
newReqDepth = 20/len(
list(mergeDF['Sample_Name'].unique())
) * 1000000
newReqDepth = round(newReqDepth, 0)
mergeDF['reqDepth'] = newReqDepth
logging.debug(
'miSEQ detected, override seqdepth: {}'.format(
newReqDepth
)
)
ssDic[key] = {'sampleSheet': mergeDF, 'lane': lane}
else:
ssDic[key] = {
Expand Down
15 changes: 13 additions & 2 deletions src/dissectBCL/dissect.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,23 @@ def main(config):
filemode='a',
force=True
)

# Set flowcellname in log.
logging.info("Log Initiated - flowcell:{}, filename:{}".format(
flowcellName,
logFile
))

# Include dissectBCL version in log
logging.info("dissectBCL - version {}".format(
version("dissectBCL")
))
# Include software versions in log
for lib in config['softwareVers']:
logging.debug(
"{} = {}".format(
lib,
config['softwareVers'][lib]
)
)
# Create classes.
flowcell = flowCellClass(
name=flowcellName,
Expand Down
4 changes: 4 additions & 0 deletions src/dissectBCL/fakeNews.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def pullParkour(flowcellID, config):
'indexType',
'reqDepth'
]
# Sanitize sample names.
parkourDF['Sample_Name'] = parkourDF['Sample_Name'].apply(
lambda x: umlautDestroyer(x)
)
# parkour lists requested in millions.
parkourDF['reqDepth'] = parkourDF['reqDepth']*1000000
# Some exceptions where there is a ' in the description..
Expand Down
3 changes: 0 additions & 3 deletions src/dissectBCL/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def getConf(configfile, quickload=False):
print("{} = {}".format(
soft, ver
))
logging.info("{} = {}".format(
soft, ver
))
# Double check if fastqc_adapters is set.
if not os.path.exists(
config['software']['fastqc_adapters']
Expand Down

0 comments on commit e181c4e

Please sign in to comment.