Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
b3bb4a8e
Commit
b3bb4a8e
authored
10 years ago
by
kohleman
Browse files
Options
Downloads
Patches
Plain Diff
added support for HiSeq and NextSeq runs
SVN: 33189
parent
ada3486a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-undetermined/register-undetermined.py
+29
-23
29 additions, 23 deletions
...drop-boxes/register-undetermined/register-undetermined.py
with
29 additions
and
23 deletions
deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-undetermined/register-undetermined.py
+
29
−
23
View file @
b3bb4a8e
...
...
@@ -24,34 +24,40 @@ import shutil
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
import
SearchCriteria
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
import
SearchSubCriteria
def
renameFiles
(
dir
,
flowcellName
):
print
dir
print
flowcellName
for
root
,
dirs
,
files
in
os
.
walk
(
dir
):
for
file
in
files
:
print
root
+
file
os
.
rename
(
root
+
'
/
'
+
file
,
root
+
"
/
"
+
flowcellName
+
"
_
"
+
file
)
def
splitFolderName
(
folderName
):
runFolder
,
lane
=
folderName
.
rsplit
(
"
-
"
,
1
)
# check if it is a NextSeq run, as we use only the Flowcell code as a Sample code
if
(
"
NS
"
in
runFolder
):
return
runFolder
.
split
(
"
_
"
)[
-
1
][
1
:]
+
"
:
"
+
lane
return
runFolder
+
"
:
"
+
lane
def
searchSample
(
transaction
,
sampleCode
):
# Get the search service
search_service
=
transaction
.
getSearchService
()
print
(
"
Searching for
"
+
sampleCode
)
# Search for the sample
sc
=
SearchCriteria
()
sc
.
addMatchClause
(
SearchCriteria
.
MatchClause
.
createAttributeMatch
(
SearchCriteria
.
MatchClauseAttribute
.
CODE
,
sampleCode
))
foundSamples
=
search_service
.
searchForSamples
(
sc
)
assert
(
len
(
foundSamples
),
1
)
return
foundSamples
[
0
]
def
process
(
transaction
):
# 140724_M01761_0084_000000000-A8TNL/
incomingPath
=
transaction
.
getIncoming
().
getPath
()
incomingFolder
=
transaction
.
getIncoming
().
getName
()
flowLane
=
incomingFolder
+
"
:1
"
# Get the search service
search_service
=
transaction
.
getSearchService
()
# Search for the sample
sc
=
SearchCriteria
()
sc
.
addMatchClause
(
SearchCriteria
.
MatchClause
.
createAttributeMatch
(
SearchCriteria
.
MatchClauseAttribute
.
CODE
,
flowLane
))
foundSamples
=
search_service
.
searchForSamples
(
sc
)
# expected incoming folder names:
# MiSeq: 141217_D00535_0040_BC6GHLANXX-1
# NextSeq: 141217_NS500318_0034_AH1766BGXX-1
# HiSeq: 141204_D00535_0035_BC5LPVANXX-8
if
foundSamples
.
size
()
>
0
:
incomingFolder
=
transaction
.
getIncoming
().
getName
()
flowLaneName
=
splitFolderName
(
incomingFolder
)
flowLane
=
searchSample
(
transaction
,
flowLaneName
)
dataSet
=
transaction
.
createNewDataSet
(
"
UNDETERMINED_READS_DISTRIBUTION
"
)
dataSet
.
setMeasuredData
(
False
)
dataSet
.
setSample
(
f
oundSamples
[
0
]
)
transaction
.
moveFile
(
i
ncomingPath
,
dataSet
)
dataSet
.
setSample
(
f
lowLane
)
transaction
.
moveFile
(
transaction
.
getI
ncoming
().
get
Path
()
,
dataSet
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment