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
f1f6bdda
Commit
f1f6bdda
authored
10 years ago
by
kohleman
Browse files
Options
Downloads
Patches
Plain Diff
- clean up
- call the master data export SVN: 33386
parent
94a326ba
No related branches found
No related tags found
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-flowcell-hiseq/register-flowcell-hiseq.py
+21
-56
21 additions, 56 deletions
...-boxes/register-flowcell-hiseq/register-flowcell-hiseq.py
with
21 additions
and
56 deletions
deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-flowcell-hiseq/register-flowcell-hiseq.py
+
21
−
56
View file @
f1f6bdda
...
@@ -29,68 +29,33 @@ Manuel Kohler
...
@@ -29,68 +29,33 @@ Manuel Kohler
'''
'''
import
os
import
os
import
shutil
import
subprocess
import
glob
import
xml.etree.ElementTree
as
etree
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
import
SearchCriteria
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
import
SearchCriteria
IS_HISEQ_RUN
=
False
RUNINFO_FOLDER
=
'
/links/shared/dsu/dss/register-runstatistics/
'
REGEX_RUNINFO_SAMPLE
=
'
/Data/Status*
'
REGEX_RUNINFO_REPORTS
=
'
/Data/reports
'
MARKER_STRING
=
'
.MARKER_is_finished_
'
def
touch_markerfile
(
filename
):
try
:
# do a touch
open
(
filename
,
'
w
'
).
close
()
except
:
print
(
'
Could not touch
'
+
filename
)
def
process
(
transaction
):
def
process
(
transaction
):
incomingPath
=
transaction
.
getIncoming
().
getPath
()
args
=
[
'
/links/application/dsu/export_QGF_master_data/export_QGF_master_data.sh
'
]
name
=
transaction
.
getIncoming
().
getName
()
folders
=
[]
try
:
folders
=
os
.
listdir
(
incomingPath
)
p
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
)
print
(
p
.
communicate
()[
0
])
except
:
print
(
"
Could not run:
"
+
str
(
args
))
split
=
name
.
split
(
"
_
"
)
incomingPath
=
transaction
.
getIncoming
().
getPath
()
if
(
len
(
split
)
==
4
):
name
=
transaction
.
getIncoming
().
getName
()
dataSet
=
transaction
.
createNewDataSet
(
"
ILLUMINA_HISEQ_OUTPUT
"
)
IS_HISEQ_RUN
=
True
if
(
len
(
split
)
==
2
):
dataSet
=
transaction
.
createNewDataSet
(
"
ILLUMINA_GA_OUTPUT
"
)
#move RunInfo into a different drop box
split
=
name
.
split
(
"
_
"
)
#runInfoSample=glob.glob(incomingPath + REGEX_RUNINFO_SAMPLE)
if
(
len
(
split
)
==
4
):
#runInfoReport=glob.glob(incomingPath + REGEX_RUNINFO_REPORTS)
dataSet
=
transaction
.
createNewDataSet
(
"
ILLUMINA_HISEQ_OUTPUT
"
)
#runInfoList = runInfoSample + runInfoReport
#os.makedirs(RUNINFO_FOLDER + name + '/Data/')
#for runInfo in runInfoList:
# try:
# if os.path.isdir(runInfo):
# shutil.copytree(runInfo, RUNINFO_FOLDER + name + '/Data/' + os.path.basename(runInfo))
# else:
# shutil.copy2(runInfo, RUNINFO_FOLDER + name + '/Data/')
# except (IOError, os.error), why:
# print (runInfo, RUNINFO_FOLDER + name, str(why))
# touch_markerfile(RUNINFO_FOLDER+MARKER_STRING+name)
dataSet
.
setMeasuredData
(
False
)
# Create a data set and set type
search_service
=
transaction
.
getSearchService
()
dataSet
.
setMeasuredData
(
False
)
sc
=
SearchCriteria
()
sc
.
addMatchClause
(
SearchCriteria
.
MatchClause
.
createAttributeMatch
(
SearchCriteria
.
MatchClauseAttribute
.
CODE
,
name
));
# Get the search service
foundSamples
=
search_service
.
searchForSamples
(
sc
)
search_service
=
transaction
.
getSearchService
()
# Search for the sample
sc
=
SearchCriteria
()
sc
.
addMatchClause
(
SearchCriteria
.
MatchClause
.
createAttributeMatch
(
SearchCriteria
.
MatchClauseAttribute
.
CODE
,
name
));
foundSamples
=
search_service
.
searchForSamples
(
sc
)
if
foundSamples
.
size
()
>
0
:
if
foundSamples
.
size
()
>
0
:
# Add the incoming file into the data set
transaction
.
moveFile
(
incomingPath
,
dataSet
)
transaction
.
moveFile
(
incomingPath
,
dataSet
)
dataSet
.
setSample
(
foundSamples
[
0
])
dataSet
.
setSample
(
foundSamples
[
0
])
\ No newline at end of file
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