Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sscocaller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
BioCellGen-public
sscocaller
Commits
460f8534
Commit
460f8534
authored
3 years ago
by
Ruqian Lyu
Browse files
Options
Downloads
Patches
Plain Diff
add cell barcode option
parent
02a1aa86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#6948
passed
3 years ago
Stage: buildStatic
Stage: testStatic
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sscocaller.nim
+11
-6
11 additions, 6 deletions
src/sscocaller.nim
with
11 additions
and
6 deletions
src/sscocaller.nim
+
11
−
6
View file @
460f8534
...
...
@@ -59,13 +59,13 @@ proc getTrans(pos1:int64,pos2:int64,cmPmb=0.1): float =
proc
countAllele
(
rec
:
Variant
,
ibam
:
Bam
,
maxTotalReads
:
int
,
minTotalReads
:
int
,
chrom
:
string
,
mapq
:
int
,
barcodeTable
:
OrderedTableRef
,
minbsq
:
int
,
bulkBam
:
bool
):
Table
[
string
,
allele_expr
]
=
barcodeTable
:
OrderedTableRef
,
minbsq
:
int
,
bulkBam
:
bool
,
barcodeTag
:
string
):
Table
[
string
,
allele_expr
]
=
var
alleleCountTable
=
initTable
[
string
,
allele_expr
]
()
var
rec_alt
:
char
var
total_reads
=
0
rec_alt
=
rec
.
ALT
[
0
][
0
]
for
aln
in
ibam
.
query
(
chrom
=
chrom
,
start
=
rec
.
POS
.
cint
-
1
,
stop
=
rec
.
POS
.
cint
):
var
cbt
=
tag
[
string
]
(
aln
,
"CB"
)
var
cbt
=
tag
[
string
]
(
aln
,
barcodeTag
)
var
currentCB
:
string
if
cbt
.
isNone
:
# echo "no cb "
...
...
@@ -127,7 +127,7 @@ proc countAllele(rec:Variant, ibam:Bam, maxTotalReads:int,
proc
sscocaller
(
threads
:
int
,
vcff
:
string
,
barcodeFile
:
string
,
bamfile
:
string
,
out_dir
:
string
,
mapq
:
int
,
minbsq
:
int
,
mintotal
:
int
,
maxtotal
:
int
,
mindp
:
int
,
maxdp
:
int
,
thetaREF
:
float
,
thetaALT
:
float
,
cmPmb
:
float
,
s_Chrs
:
seq
):
int
=
thetaREF
:
float
,
thetaALT
:
float
,
cmPmb
:
float
,
s_Chrs
:
seq
,
barcodeTag
:
string
):
int
=
var
ibam
:
Bam
...
...
@@ -202,7 +202,8 @@ proc sscocaller(threads:int, vcff:string, barcodeFile:string,
minbsq
=
minbsq
,
maxTotalReads
=
maxtotal
,
minTotalReads
=
mintotal
,
bulkBam
=
bulkBam
)
bulkBam
=
bulkBam
,
barcodeTag
=
barcodeTag
)
if
alleleCountTable
.
len
==
0
:
continue
var
rec_alt
:
char
...
...
@@ -404,7 +405,7 @@ proc sscocaller(threads:int, vcff:string, barcodeFile:string,
return
0
when
(
isMainModule
):
let
version
=
"0.2.
0
"
let
version
=
"0.2.
1
"
var
doc
=
format
(
"""
$version
...
...
@@ -424,6 +425,7 @@ Arguments:
Options:
-t --threads <threads> number of BAM decompression threads [default: 4]
-cb --cellbarcode <cellbarcode> the cell barcode tag, by default it is CB
-MQ --minMAPQ <mapq> Minimum MAPQ for read filtering [default: 20]
-BQ --baseq <baseq> base quality threshold for a base to be used for counting [default: 13]
-CHR --chrom <chrom> the selected chromsome (whole genome if not supplied,separate by comma if multiple chroms)
...
...
@@ -459,9 +461,12 @@ Options:
thetaREF
:
float
thetaALT
:
float
cmPmb
:
float
barcodeTag
=
"CB"
if
(
$
args
[
"--threads"
]
!=
"nil"
):
threads
=
parse_int
(
$
args
[
"--threads"
]
)
if
(
$
args
[
"--cellbarcode"
]
!=
"nil"
):
barcodeTag
=
$
args
[
"--barcodeTag"
]
else
:
threads
=
4
if
(
$
args
[
"--minDP"
]
!=
"nil"
):
mindp
=
parse_int
(
$
args
[
"--minDP"
]
)
...
...
@@ -530,5 +535,5 @@ Options:
#var args = commandLineParams()
discard
sscocaller
(
threads
,
vcff
,
barcodeFile
,
bamfile
,
out_dir
,
mapq
,
minbsq
,
mintotal
,
maxtotal
,
mindp
,
maxdp
,
thetaREF
,
thetaALT
,
cmPmb
,
s_Chrs
)
maxtotal
,
mindp
,
maxdp
,
thetaREF
,
thetaALT
,
cmPmb
,
s_Chrs
,
barcodeTag
)
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