Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
process_scripts
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
NGS CLIA Lab
process_scripts
Commits
a4a2a4db
Commit
a4a2a4db
authored
6 years ago
by
Brandi Cantarel
Browse files
Options
Downloads
Patches
Plain Diff
adding pindel
parent
f7278ea1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
variants/germline_vc.sh
+1
-1
1 addition, 1 deletion
variants/germline_vc.sh
variants/parse_pindel.pl
+94
-0
94 additions, 0 deletions
variants/parse_pindel.pl
variants/pindel.sh
+63
-0
63 additions, 0 deletions
variants/pindel.sh
variants/svcalling.sh
+5
-20
5 additions, 20 deletions
variants/svcalling.sh
with
163 additions
and
21 deletions
variants/germline_vc.sh
+
1
−
1
View file @
a4a2a4db
...
...
@@ -79,7 +79,7 @@ then
java
-jar
$SNPEFF_HOME
/SnpSift.jar annotate
${
index_path
}
/cosmic.vcf.gz
${
pair_id
}
.lowfreq.vcf.gz | java
-jar
$SNPEFF_HOME
/SnpSift.jar filter
"(CNT[*] >0)"
- |bgzip
>
${
pair_id
}
.hotspot.vcf.gz
elif
[[
$algo
==
'speedseq'
]]
then
module load speedseq/
20160506
module load speedseq/
gcc/0.1.2
speedseq var
-t
$SLURM_CPUS_ON_NODE
-o
ssvar
${
reffa
}
*
.bam
vcf-annotate
-n
--fill-type
ssvar.vcf.gz| bcftools norm
-c
s
-f
${
reffa
}
-w
10
-O
z
-o
${
pair_id
}
.ssvar.vcf.gz -
elif
[[
$algo
==
'gatk'
]]
...
...
This diff is collapsed.
Click to expand it.
variants/parse_pindel.pl
0 → 100755
+
94
−
0
View file @
a4a2a4db
#!/usr/bin/perl
#parse_pindel
my
$pair_id
=
shift
@ARGV
;
my
$tid
=
shift
@ARGV
;
my
$vcf
=
shift
@ARGV
;
open
SI
,
"
>
$pair_id
.indel.vcf
"
or
die
$!
;
open
SV
,
"
>
$pair_id
.sv.vcf
"
or
die
$!
;
open
DUP
,
"
>
$pair_id
.dup.vcf
"
or
die
$!
;
open
VCF
,
"
gunzip -c
$vcf
|
"
or
die
$!
;
while
(
my
$line
=
<
VCF
>
)
{
chomp
(
$line
);
if
(
$line
=~
m/#/
)
{
print
SI
$line
,"
\n
";
print
SV
$line
,"
\n
";
print
DUP
$line
,"
\n
";
if
(
$line
=~
m/#CHROM/
)
{
my
@header
=
split
(
/\t/
,
$line
);
(
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$info
,
$format
,
@subjacc
)
=
split
(
/\t/
,
$line
);
}
next
;
}
my
(
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$annot
,
$format
,
@gts
)
=
split
(
/\t/
,
$line
);
my
%hash
=
();
foreach
$a
(
split
(
/;/
,
$annot
))
{
my
(
$key
,
$val
)
=
split
(
/=/
,
$a
);
$hash
{
$key
}
=
$val
;
}
my
@deschead
=
split
(
/:/
,
$format
);
my
$newformat
=
'
GT:DP:AD:AO:RO
';
my
@newgts
=
();
my
$missingGT
=
0
;
my
%allele
;
FG:foreach
my
$i
(
0
..
$#gts
)
{
my
$sid
=
$subjacc
[
$i
];
my
@gtinfo
=
split
(
/:/
,
$gts
[
$i
]);
my
%gtdata
;
if
(
$allele_info
eq
'
.
')
{
push
@newgts
,
'
.:.:.:.:.
';
$missingGT
++
;
next
FG
;
}
foreach
my
$i
(
0
..
$#deschead
)
{
$gtdata
{
$deschead
[
$i
]}
=
$gtinfo
[
$i
];
}
if
(
$gtdata
{
AD
}){
(
$gtdata
{
RO
},
@alts
)
=
split
(
/,/
,
$gtdata
{
AD
});
$gtdata
{
AO
}
=
join
("
,
",
@alts
);
$gtdata
{
DP
}
=
$gtdata
{
RO
};
foreach
(
@alts
)
{
$gtdata
{
DP
}
+=
$_
;
}
}
elsif
(
exists
$gtdata
{
NR
}
&&
exists
$gtdata
{
NV
})
{
$gtdata
{
DP
}
=
$gtdata
{
NR
};
$gtdata
{
AO
}
=
$gtdata
{
NV
};
$gtdata
{
RO
}
=
$gtdata
{
DP
}
-
$gtdata
{
AO
};
}
elsif
(
exists
$gtdata
{
AO
}
&&
exists
$gtdata
{
RO
})
{
$gtdata
{
AD
}
=
join
('
,
',
$gtdata
{
RO
},
$gtdata
{
AO
});
$gtdata
{
DP
}
=
$gtdata
{
RO
};
foreach
(
split
('
,
',
$gtdata
{
AO
}))
{
$gtdata
{
DP
}
+=
$_
;
}
}
if
((
$gtdata
{
DP
}
&&
$gtdata
{
DP
}
<
10
)
||
())
{
$missingGT
++
;
}
if
(
$gtdata
{
DP
}
==
0
||
$gtdata
{
GT
}
eq
'
./.
')
{
push
@newgts
,
'
.:.:.:.:.
';
$missingGT
++
;
next
FG
;
}
$allele
{
$tid
}
=
[
sprintf
("
%.4f
",
$gtdata
{
AO
}
/
$gtdata
{
DP
}),
$gtdata
{
DP
}];
push
@newgts
,
join
("
:
",
$gtdata
{
GT
},
$gtdata
{
DP
},
$gtdata
{
AD
},
$gtdata
{
AO
},
$gtdata
{
RO
});
}
next
if
(
$missingGT
==
scalar
(
@gts
));
next
unless
(
$allele
{
$tid
});
my
(
$taf
,
$tdp
)
=
@
{
$allele
{
$tid
}};
next
if
(
$taf
<
0.05
&&
$tdp
<
10
);
if
(
$hash
{
SVTYPE
}
eq
'
DUP:TANDEM
')
{
print
DUP
join
("
\t
",
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$annot
,
$newformat
,
@newgts
),"
\n
";
}
elsif
(
$hash
{
SVTYPE
}
eq
'
INS
')
{
print
SV
join
("
\t
",
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$annot
,
$newformat
,
@newgts
),"
\n
";
}
elsif
(
$hash
{
SVTYPE
}
eq
'
DEL
'
||
$hash
{
SVTYPE
}
eq
'
INS
')
{
if
(
abs
(
$hash
{
SVLEN
})
<
50
)
{
print
SI
join
("
\t
",
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$annot
,
$newformat
,
@newgts
),"
\n
";
}
else
{
print
SV
join
("
\t
",
$chrom
,
$pos
,
$id
,
$ref
,
$alt
,
$score
,
$filter
,
$annot
,
$newformat
,
@newgts
),"
\n
";
}
}
}
close
VCF
;
This diff is collapsed.
Click to expand it.
variants/pindel.sh
0 → 100644
+
63
−
0
View file @
a4a2a4db
#!/bin/bash
#svcalling.sh
usage
()
{
echo
"-h Help documentation for gatkrunner.sh"
echo
"-r --Path to Reference Genome with the file genome.fa"
echo
"-p --Prefix for output file name"
echo
"Example: bash svcalling.sh -p prefix -r /path/GRCh38 -a gatk"
exit
1
}
OPTIND
=
1
# Reset OPTIND
while
getopts
:r:p:h opt
do
case
$opt
in
r
)
index_path
=
$OPTARG
;;
p
)
pair_id
=
$OPTARG
;;
h
)
usage
;;
esac
done
function
join_by
{
local
IFS
=
"
$1
"
;
shift
;
echo
"
$*
"
;
}
shift
$((
$OPTIND
-
1
))
baseDir
=
"
`
dirname
\"
$0
\"
`
"
# Check for mandatory options
if
[[
-z
$pair_id
]]
||
[[
-z
$index_path
]]
;
then
usage
fi
if
[[
-z
$SLURM_CPUS_ON_NODE
]]
then
SLURM_CPUS_ON_NODE
=
1
fi
if
[[
-a
"
${
index_path
}
/genome.fa"
]]
then
reffa
=
"
${
index_path
}
/genome.fa"
dict
=
"
${
index_path
}
/genome.dict"
else
echo
"Missing Fasta File:
${
index_path
}
/genome.fa"
usage
fi
source
/etc/profile.d/modules.sh
genomefiledate
=
`
find
${
reffa
}
-maxdepth
0
-printf
"%TY%Tm%Td
\n
"
`
module load samtools/1.6 pindel/0.2.5-intel snpeff/4.3q
touch
${
pair_id
}
.pindel.config
for
i
in
*
.bam
;
do
sname
=
"
${
i
%.bam
}
"
echo
-e
"
${
i
}
\t
400
\t
${
sname
}
"
>>
${
pair_id
}
.pindel.config
done
pindel
-T
$SLURM_CPUS_ON_NODE
-f
${
reffa
}
-i
${
pair_id
}
.pindel.config
-o
${
pair_id
}
.pindel_out
--RP
pindel2vcf
-P
${
pair_id
}
.pindel_out
-r
${
reffa
}
-R
HG38
-d
${
genomefiledate
}
-v
pindel.vcf
cat
pindel.vcf | java
-jar
$SNPEFF_HOME
/SnpSift.jar filter
" ( GEN[*].AD[1] >= 10 )"
| bgzip
>
pindel.vcf.gz
perl
$baseDir
/norm_annot.sh
-r
${
index_path
}
-p
pindel
-v
pindel.vcf.gz
perl
$baseDir
/parse_pindel.pl
${
pair_id
}
$tid
pindel.norm.vcf.gz
java
-Xmx10g
-jar
$SNPEFF_HOME
/snpEff.jar
-no-intergenic
-lof
-c
$SNPEFF_HOME
/snpEff.config GRCh38.86
${
pair_id
}
.indel.vcf |bgzip
>
${
pair_id
}
.pindel_indel.vcf.gz
java
-Xmx10g
-jar
$SNPEFF_HOME
/snpEff.jar
-no-intergenic
-lof
-c
$SNPEFF_HOME
/snpEff.config GRCh38.86
${
pair_id
}
.dup.vcf |bgzip
>
${
pair_id
}
.pindel_tandemdup.vcf.gz
java
-Xmx10g
-jar
$SNPEFF_HOME
/snpEff.jar
-no-intergenic
-lof
-c
$SNPEFF_HOME
/snpEff.config GRCh38.86
${
pair_id
}
.sv.vcf |bgzip
>
${
pair_id
}
.pindel_sv.vcf.gz
This diff is collapsed.
Click to expand it.
variants/svcalling.sh
+
5
−
20
View file @
a4a2a4db
...
...
@@ -11,16 +11,15 @@ usage() {
exit
1
}
OPTIND
=
1
# Reset OPTIND
while
getopts
:r:p:b:
t:
i:
k
:n:
m
:h opt
while
getopts
:r:p:b:i:
e
:n:
a
:h opt
do
case
$opt
in
r
)
index_path
=
$OPTARG
;;
p
)
pair_id
=
$OPTARG
;;
b
)
sbam
=
$OPTARG
;;
k
)
tid
=
$OPTARG
;;
i
)
nid
=
$OPTARG
;;
i
)
tid
=
$OPTARG
;;
n
)
normal
=
$OPTARG
;;
m
)
method
=
$OPTARG
;;
a
)
method
=
$OPTARG
;;
h
)
usage
;;
esac
done
...
...
@@ -48,25 +47,11 @@ else
usage
fi
source
/etc/profile.d/modules.sh
module load
speedseq/20160506 novoBreak/v1.1.3 delly2/v0.7.7-multi
samtools/1.6 bedtools/2.26.0 snpeff/4.3q vcftools/0.1.14
module load samtools/1.6 bedtools/2.26.0 snpeff/4.3q vcftools/0.1.14
mkdir
temp
genomefiledate
=
`
find
${
reffa
}
-maxdepth
0
-printf
"%TY%Tm%Td
\n
"
`
if
[[
$method
==
'pindel'
]]
then
module load samtools/1.6 pindel/0.2.5-intel snpeff/4.3q
echo
-e
"
${
sbam
}
\t
400
\t
${
tid
}
"
>
${
pair_id
}
.pindel.config
if
[[
-n
${
normal
}
]]
then
echo
-e
"
${
normal
}
\t
400
\t
${
nid
}
"
>>
${
pair_id
}
.pindel.config
fi
pindel
-T
$SLURM_CPUS_ON_NODE
-f
${
reffa
}
-i
${
pair_id
}
.pindel.config
-o
${
pair_id
}
.pindel_out
--RP
pindel2vcf
-P
${
pair_id
}
.pindel_out
-r
${
reffa
}
-R
HG38
-d
${
genomefiledate
}
-v
pindel.vcf
java
-Xmx10g
-jar
$SNPEFF_HOME
/snpEff.jar
-no-intergenic
-lof
-c
$SNPEFF_HOME
/snpEff.config GRCh38.86 pindel.vcf | java
-jar
$SNPEFF_HOME
/SnpSift.jar filter
" ( GEN[*].AD[1] >= 20 )"
| bgzip
>
${
pair_id
}
.pindel.vcf.gz
fi
if
[[
$method
==
'delly'
]]
then
module load delly2/v0.7.7-multi samtools/1.6 snpeff/4.3q
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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