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
0a8acb9b
Commit
0a8acb9b
authored
6 years ago
by
Brandi Cantarel
Browse files
Options
Downloads
Patches
Plain Diff
answer compatible cnvkit files
parent
54ce33db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
variants/filter_cnvkit.pl
+34
-7
34 additions, 7 deletions
variants/filter_cnvkit.pl
with
34 additions
and
7 deletions
variants/filter_cnvkit.pl
+
34
−
7
View file @
0a8acb9b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#parse_cnvkit_table.pl
#parse_cnvkit_table.pl
my
$refdir
=
'
/project/shared/bicf_workflow_ref/GRCh38/
';
my
$refdir
=
'
/project/shared/bicf_workflow_ref/GRCh38/
';
open
OM
,
"
<
$refdir
\
/clinseq_prj/panel1
385
.genelist.txt
"
or
die
$!
;
open
OM
,
"
<
$refdir
\
/clinseq_prj/panel1
410
.genelist.txt
"
or
die
$!
;
while
(
my
$line
=
<
OM
>
)
{
while
(
my
$line
=
<
OM
>
)
{
chomp
(
$line
);
chomp
(
$line
);
$keep
{
$line
}
=
1
;
$keep
{
$line
}
=
1
;
...
@@ -27,25 +27,50 @@ while (my $line = <ENT_SYM>){
...
@@ -27,25 +27,50 @@ while (my $line = <ENT_SYM>){
close
ENT_SYM
;
close
ENT_SYM
;
my
$file
=
shift
@ARGV
;
my
$file
=
shift
@ARGV
;
my
$prefix
=
(
split
(
/\./
,(
split
(
/\//
,
$file
))[
0
]))[
0
];
my
$sname
=
(
split
(
/\./
,(
split
(
/\//
,
$file
))[
-
1
]))[
0
];
my
$prefix
=
(
split
(
/\./
,
$file
))[
0
];
my
%cyto
;
my
%cyto
;
open
CYTO
,
"
<
$prefix
\
.cytoband.bed
"
or
die
$!
;
open
CYTO
,
"
<
$prefix
\
.cytoband.bed
"
or
die
$!
;
while
(
my
$line
=
<
CYTO
>
)
{
while
(
my
$line
=
<
CYTO
>
)
{
chomp
(
$line
);
chomp
(
$line
);
my
(
$chrom
,
$start
,
$end
,
$band
)
=
split
(
/\t/
,
$line
);
my
(
$chrom
,
$start
,
$end
,
$band
)
=
split
(
/\t/
,
$line
);
my
$key
=
$chrom
.
"
:
"
.
$start
.
"
-
"
.
$end
;
my
$key
=
$chrom
.
"
:
"
.
$start
.
"
-
"
.
$end
;
push
@
{
$cyto
{
$key
}},
$band
;
$band
=~
m/^(\w)(.+)/
;
push
@
{
$cyto
{
$key
}},
[
$
1
,
$
2
];
}
}
open
OUT
,
"
>
$prefix
\
.cnvcalls.txt
"
or
die
$!
;
open
OUT
,
"
>
$prefix
\
.cnvcalls.txt
"
or
die
$!
;
open
OUT2
,
"
>
$prefix
\
.cnv.answer.txt
"
or
die
$!
;
open
OUT2
,
"
>
$prefix
\
.cnv.answer.txt
"
or
die
$!
;
open
OUT3
,
"
>
$prefix
\
.answerplot.cns
"
or
die
$!
;
open
BIO
,
"
>
$prefix
\
.data_cna_discrete.cbioportal.txt
"
or
die
$!
;
open
BIO
,
"
>
$prefix
\
.data_cna_discrete.cbioportal.txt
"
or
die
$!
;
open
BIO2
,
"
>
$prefix
\
.data_cna_continuous.cbioportal.txt
"
or
die
$!
;
open
BIO2
,
"
>
$prefix
\
.data_cna_continuous.cbioportal.txt
"
or
die
$!
;
print
OUT
join
("
\t
","
Gene
","
Chromosome
","
Start
","
End
","
Abberation Type
","
CN
","
Score
"),"
\n
";
print
OUT
join
("
\t
","
Gene
","
Chromosome
","
Start
","
End
","
Abberation Type
","
CN
","
Score
"),"
\n
";
print
OUT3
join
("
\t
","
Chromosome
","
Start
","
End
","
Log2
","
CN
"),"
\n
";
print
OUT2
join
("
\t
","
Gene
","
Chromosome
","
Start
","
End
","
Abberation Type
","
CN
","
Score
","
CytoBand
"),"
\n
";
print
OUT2
join
("
\t
","
Gene
","
Chromosome
","
Start
","
End
","
Abberation Type
","
CN
","
Score
","
CytoBand
"),"
\n
";
print
BIO
join
("
\t
","
Hugo_Symbol
","
Entrez_Gene_Id
",
$prefix
),"
\n
";
print
BIO
join
("
\t
","
Hugo_Symbol
","
Entrez_Gene_Id
",
$sname
),"
\n
";
print
BIO2
join
("
\t
","
Hugo_Symbol
","
Entrez_Gene_Id
",
$prefix
),"
\n
";
print
BIO2
join
("
\t
","
Hugo_Symbol
","
Entrez_Gene_Id
",
$sname
),"
\n
";
open
CNR
,
"
<
$prefix
\
.cnr
"
or
die
$!
;
open
CNRO
,
"
>
$prefix
\
.answerplot.cnr
"
or
die
$!
;
print
CNRO
join
("
\t
","
Gene
","
Chromosome
","
Start
","
End
","
Log2
","
Depth
","
Weight
"),"
\n
";
my
$header
=
<
CNR
>
;
while
(
my
$line
=
<
CNR
>
)
{
chomp
(
$line
);
my
(
$chr
,
$start
,
$end
,
$geneids
,
$log2
,
$depth
,
$weight
)
=
split
(
/\t/
,
$line
);
my
$key
=
$chr
.
"
:
"
.
$start
.
"
-
"
.
$end
;
my
%genes
;
my
@ids
=
split
(
/;|,/
,
$geneids
);
foreach
my
$gid
(
@ids
)
{
my
(
$key
,
$value
)
=
split
(
/=/
,
$gid
);
if
(
$key
eq
'
ensembl_gn
'
||
$key
eq
'
identifier
')
{
$genes
{
$value
}
=
1
if
$keep
{
$value
};
}
}
foreach
$gene
(
keys
%genes
)
{
print
CNRO
join
("
\t
",
$gene
,
$chr
,
$start
,
$end
,
$log2
,
$depth
,
$weight
),"
\n
";
}
}
open
IN
,
"
<
$file
"
or
die
$!
;
open
IN
,
"
<
$file
"
or
die
$!
;
my
$header
=
<
IN
>
;
my
$header
=
<
IN
>
;
...
@@ -64,6 +89,7 @@ while (my $line = <IN>) {
...
@@ -64,6 +89,7 @@ while (my $line = <IN>) {
}
}
}
}
my
$len
=
sprintf
("
%.1f
",(
$end
-
$start
)
/
1000
);
my
$len
=
sprintf
("
%.1f
",(
$end
-
$start
)
/
1000
);
print
OUT3
join
("
\t
",
$chr
,
$start
,
$end
,
$log2
,
$cn
),"
\n
";
next
if
(
$cn
==
2
)
||
scalar
(
keys
%genes
)
<
1
;
next
if
(
$cn
==
2
)
||
scalar
(
keys
%genes
)
<
1
;
my
$abtype
=
'
amplification
';
my
$abtype
=
'
amplification
';
$abtype
=
'
loss
'
if
(
$cn
<
2
);
$abtype
=
'
loss
'
if
(
$cn
<
2
);
...
@@ -73,7 +99,8 @@ while (my $line = <IN>) {
...
@@ -73,7 +99,8 @@ while (my $line = <IN>) {
$cn_cbio
=
2
if
(
$cn
>
4
);
$cn_cbio
=
2
if
(
$cn
>
4
);
print
BIO
join
("
\t
",
$gene
,
$entrez
{
$gene
},
$cn_cbio
),"
\n
";
print
BIO
join
("
\t
",
$gene
,
$entrez
{
$gene
},
$cn_cbio
),"
\n
";
print
BIO2
join
("
\t
",
$gene
,
$entrez
{
$gene
},
$log2
),"
\n
";
print
BIO2
join
("
\t
",
$gene
,
$entrez
{
$gene
},
$log2
),"
\n
";
print
OUT2
join
("
\t
",
$gene
,
$chr
,
$start
,
$end
,
$abtype
,
$cn
,
$weight
,
join
("
,
",
@
{
$cyto
{
$key
}})),"
\n
";
my
@cytoband
=
sort
{
$a
->
[
1
]
<=>
$b
->
[
1
]}
@
{
$cyto
{
$key
}};
print
OUT2
join
("
\t
",
$gene
,
$chr
,
$start
,
$end
,
$abtype
,
$cn
,
$weight
,
join
("",
@
{
$cytoband
[
0
]},'
-
',
@
{
$cytoband
[
-
1
]})),"
\n
";
print
OUT
join
("
\t
",
$gene
,
$chr
,
$start
,
$end
,
$abtype
,
$cn
,
$weight
),"
\n
";
print
OUT
join
("
\t
",
$gene
,
$chr
,
$start
,
$end
,
$abtype
,
$cn
,
$weight
),"
\n
";
}
}
}
}
...
...
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