Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ONT_pilot_gitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESB
ONT_pilot_gitlab
Commits
757cefb2
Commit
757cefb2
authored
4 years ago
by
Valentina Galata
Browse files
Options
Downloads
Patches
Plain Diff
analysis: cov seg: more threads (rule), rm short contigs (script) (issue
#107
)
parent
3f62a5f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
workflow/rules/analysis.smk
+2
-2
2 additions, 2 deletions
workflow/rules/analysis.smk
workflow/scripts/cov_multimod_segclust2d.R
+12
-3
12 additions, 3 deletions
workflow/scripts/cov_multimod_segclust2d.R
with
14 additions
and
5 deletions
workflow/rules/analysis.smk
+
2
−
2
View file @
757cefb2
...
...
@@ -365,10 +365,10 @@ rule analysis_genomecov_segmentation:
tool="|".join(ASSEMBLERS)
params:
lmin=10000,
threads:
5
threads:
10
conda:
os.path.join(ENV_DIR, "segclust2d.yaml")
message:
"Analysis: contig coverage multi-modality: {input}"
script:
os.path.join(SRC_DIR, "cov_multimod_segclust2d.R")
\ No newline at end of file
os.path.join(SRC_DIR, "cov_multimod_segclust2d.R")
This diff is collapsed.
Click to expand it.
workflow/scripts/cov_multimod_segclust2d.R
+
12
−
3
View file @
757cefb2
...
...
@@ -99,17 +99,26 @@ states_median_sd <- function(covs, states){
# lmin param. for segclust2d::segmentation
LMIN
<-
snakemake
@
params
$
lmin
# LMIN <- 1e4
# per-base coverage
COV
<-
read_perbase_cov
(
snakemake
@
input
$
cov
)
# COV <- read_perbase_cov("/scratch/users/vgalata/nwc/results/mapping/metag/lr/flye/ASSEMBLY.POLISHED.sr.cov.perbase")
print
(
sprintf
(
"Read in %s: %d x %d, %d contigs"
,
snakemake
@
input
$
cov
,
nrow
(
COV
),
ncol
(
COV
),
length
(
unique
(
COV
$
contig
))))
print
(
head
(
COV
))
# filter by contig length
CLEN
<-
COV
%>%
group_by
(
contig
)
%>%
summarise
(
length
=
length
(
base
)
)
%>%
filter
(
length
>=
2
*
LMIN
)
# contig IDs
CID
<-
sort
(
unique
(
COV
$
contig
))
CID
<-
CLEN
$
contig
names
(
CID
)
<-
CID
print
(
sprintf
(
"Contigs w/ length >= 2 * %d: %d"
,
LMIN
,
length
(
CID
)))
# filter cov table
COV
<-
as.data.frame
(
COV
%>%
filter
(
contig
%in%
CID
))
# coverage segmentation
CID_SEG
<-
mclapply
(
...
...
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