Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Jun 19, 2015
2 parents 32f8143 + 2c6c3cf commit 0a05193
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 73 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ docs/pod_html/Sanger/CGP/Grass/GenomeData/Transcript.html
docs/pod_html/Sanger/CGP/Grass/VcfContigs.html
docs/pod_html/Sanger/CGP/Grass/VcfConverter.html
docs/reports_html/common.js
docs/reports_html/cover.14
docs/reports_html/cover.css
docs/reports_html/coverage.html
docs/reports_html/css.js
Expand Down
4 changes: 2 additions & 2 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560",
"generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.142690",
"license" : [
"agpl_3"
],
Expand Down Expand Up @@ -45,5 +45,5 @@
}
},
"release_status" : "stable",
"version" : "v1.0.1"
"version" : "v1.1.0"
}
28 changes: 14 additions & 14 deletions MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ abstract: unknown
author:
- unknown
build_requires:
ExtUtils::MakeMaker: 0
ExtUtils::MakeMaker: '0'
configure_requires:
ExtUtils::MakeMaker: 0
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560'
generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.142690'
license: open_source
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
version: '1.4'
name: Grass
no_index:
directory:
- t
- inc
requires:
Attribute::Abstract: 1.02
Bio::DB::Sam: 1.39
Bio::Root::Version: 1.006923
Const::Fast: 0.014
Devel::Cover: 1.09
List::Util: 1.38
Pod::Coverage: 0.23
Sub::Exporter::Progressive: 0.001011
Try::Tiny: 0.19
version: v1.0.1
Attribute::Abstract: '1.02'
Bio::DB::Sam: '1.39'
Bio::Root::Version: '1.006923'
Const::Fast: '0.014'
Devel::Cover: '1.09'
List::Util: '1.38'
Pod::Coverage: '0.23'
Sub::Exporter::Progressive: '0.001011'
Try::Tiny: '0.19'
version: v1.1.0
Binary file modified docs.tar.gz
Binary file not shown.
12 changes: 6 additions & 6 deletions lib/Sanger/CGP/Grass.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package Sanger::CGP::Grass;

##########LICENCE##########
# Copyright (c) 2014 Genome Research Ltd.
#
#
# Author: Lucy Stebbings <cgpit@sanger.ac.uk>
#
#
# This file is part of grass.
#
#
# grass is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##########LICENCE##########
Expand All @@ -25,6 +25,6 @@ package Sanger::CGP::Grass;
use strict;
use Const::Fast qw(const);

our $VERSION = '1.0.1';
our $VERSION = '1.1.0';

1;
2 changes: 1 addition & 1 deletion lib/Sanger/CGP/Grass/FlankingBases.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sub new {

if ($args{-infile}) { $self->infile($args{-infile}); }
if ($args{-ref}) { $self->ref($args{-ref}); }
if ($args{-flip_strand}) { $self->{-flip_strand} = $args{-flip_strand}; }
if ($args{-flip_strand}) { $self->flip_strand($args{-flip_strand}); }

return $self;
}
Expand Down
14 changes: 10 additions & 4 deletions lib/Sanger/CGP/Grass/VcfConverter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sub new {

if ($args{-infile}) { $self->infile($args{-infile}); }
if ($args{-contigs}) { $self->{_contigs} = $args{-contigs}; }
if ($args{-flip_strand}) { $self->{-flip_strand} = $args{-flip_strand}; }
if ($args{-flip_strand}) { $self->flip_strand($args{-flip_strand}); }

$self->{_format} = 'RC';

Expand Down Expand Up @@ -192,13 +192,14 @@ sub gen_header{
{key => 'INFO', ID => 'RGN', Number => 1, Type => 'String', Description => 'Region where nucleotide variant (breakpoint) occurs in relation to a gene'},
{key => 'INFO', ID => 'RGNNO', Number => 1, Type => 'Integer', Description => 'Number of intron/exon where nucleotide variant (breakpoint) occurs in relation to a gene'},
{key => 'INFO', ID => 'RGNC', Number => 1, Type => 'Integer', Description => 'Count of total number of introns/exons in stated transcript'},
{key => 'INFO', ID => 'TSRDS', Number => '.', Type => 'String', Description => 'Reads from the tumour sample ('.$mt_sample->name.') that span to this rearrangement'},
{key => 'INFO', ID => 'NSRDS', Number => '.', Type => 'String', Description => 'Reads from the normal sample ('.$wt_sample->name.') that span to this rearrangement'},
{key => 'INFO', ID => 'TRDS', Number => '.', Type => 'String', Description => 'Reads from the tumour sample ('.$mt_sample->name.') that contribute to this rearrangement'},
{key => 'INFO', ID => 'NRDS', Number => '.', Type => 'String', Description => 'Reads from the normal sample ('.$wt_sample->name.') that contribute to this rearrangement'},
];

# details info layout for the tumour and the normal column
my $format = [
# {key => 'FORMAT', ID => 'GT', Number => 1, Type => 'String', Description => 'Genotype'},
{key => 'FORMAT', ID => 'RC', Number => 1, Type => 'Integer', Description => 'Count of countributing reads'},
];

Expand Down Expand Up @@ -498,12 +499,17 @@ sub gen_record {
$rec2 .= 'FL='.$firstlast2.';' if ($firstlast2);
}

if($names) {
$rec1 .= 'TSRDS='.$names;
$rec2 .= 'TSRDS='.$names;
}

# FORMAT FIELDS
# in format put read counts for: normal, tumour

# FORMAT
$normal_count = q{} unless(defined $normal_count);
$tumour_count = q{} unless(defined $tumour_count);
$normal_count = q{0} unless(defined $normal_count);
$tumour_count = q{0} unless(defined $tumour_count);
$rec1 .= SEP.$self->{_format}.SEP.$normal_count.SEP.$tumour_count;
$rec2 .= SEP.$self->{_format}.SEP.$normal_count.SEP.$tumour_count;

Expand Down
26 changes: 20 additions & 6 deletions t/grass.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,25 @@ use FindBin qw($Bin);
#my $genome_cache = '/lustre/scratch104/sanger/am3/vagrent/e74/Homo_sapiens.GRCh37.74.vagrent.cache.gz';
my $genome_cache = "$Bin/../testData/vagrent.cache.gz";
my $ref = "$Bin/../testData/genome.fa";
if(exists $ENV{GRASS_GRCH37_FA}) {
$ref = $ENV{GRASS_GRCH37_FA};
}

my $script = $Bin.'/../bin/' . 'grass.pl';
my $tmpdir = tempdir( CLEANUP => 1 );

test_coord_input();
note $tmpdir;

SKIP: {
unless(-e $ref) {
my $message = "SKIPPING: Reference *.fa not found at '$ref', set ENV: GRASS_GRCH37_FA to enable these tests";
warn "$message\n";
skip $message, '3';
}
test_coord_input();
test_file_input_bedpe();
}
test_file_input();
test_file_input_bedpe();


#----------------------------------------------------------------------------------------#
sub test_coord_input {
Expand Down Expand Up @@ -97,6 +109,8 @@ sub test_file_input_bedpe {
my $testfile_out_vcf = "$tmpdir/testout_Brass_ann.vcf";

ok(copy($infile, $testfile), 'setup files');

unless (-e $ref) { die "ERROR: ref file $ref does not exist. exiting\n"; }
my $command = "$^X $script -genome_cache $genome_cache -file $testfile -ref $ref";
note "$command\n";
my ($out, $err, @result) = capture { system($command); };
Expand All @@ -116,14 +130,14 @@ sub test_file_input_bedpe {

my $slurp_testfile_out = slurp_file($testfile_out);
my $slurp_outfile = slurp_file($outfile);
is_deeply($slurp_testfile_out, $slurp_testfile_out, 'correct bedpe file created');
is_deeply($slurp_testfile_out, $slurp_outfile, 'correct bedpe file created');

my $slurp_testfile_out_vcf = slurp_file($testfile_out_vcf);
my $slurp_outfile_vcf = slurp_file($outfile_vcf);

# path of reference file will differ so remove from comparison
splice(@{$slurp_testfile_out_vcf}, 3);
splice(@{$slurp_outfile_vcf}, 3);
splice(@{$slurp_testfile_out_vcf}, 3,1);
splice(@{$slurp_outfile_vcf}, 3,1);

is_deeply($slurp_testfile_out_vcf, $slurp_outfile_vcf, 'correct vcf file created');
}
Expand Down
6 changes: 4 additions & 2 deletions testData/test_VcfConverterII_ann.vcf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##fileformat=VCFv4.1
##fileDate=20140512
##source_20140512.1=VcfConverter.t_v1.0.1
##source_20140512.1=VcfConverter.t_v1.1.0
##reference=/nfs/users/nfs_l/las/CGP_github/grass/t/../testData/genome.fa
##contig=<ID=1,assembly=GRC37,length=249250621,species=HUMAN>
##contig=<ID=2,assembly=GRC37,length=243199373,species=HUMAN>
Expand Down Expand Up @@ -54,10 +54,12 @@
##INFO=<ID=RGN,Number=1,Type=String,Description="Region where nucleotide variant (breakpoint) occurs in relation to a gene">
##INFO=<ID=RGNNO,Number=1,Type=Integer,Description="Number of intron/exon where nucleotide variant (breakpoint) occurs in relation to a gene">
##INFO=<ID=RGNC,Number=1,Type=Integer,Description="Count of total number of introns/exons in stated transcript">
##INFO=<ID=TSRDS,Number=.,Type=String,Description="Reads from the tumour sample (PD1234a) that span to this rearrangement">
##INFO=<ID=NSRDS,Number=.,Type=String,Description="Reads from the normal sample (PD1234b) that span to this rearrangement">
##INFO=<ID=TRDS,Number=.,Type=String,Description="Reads from the tumour sample (PD1234a) that contribute to this rearrangement">
##INFO=<ID=NRDS,Number=.,Type=String,Description="Reads from the normal sample (PD1234b) that contribute to this rearrangement">
##FORMAT=<ID=RC,Number=1,Type=Integer,Description="Count of countributing reads">
##vcfProcessLog_20140512.1=<InputVCFSource=<VcfConverter.t>,InputVCFVer=<1.0.1>>
##vcfProcessLog_20140512.1=<InputVCFSource=<VcfConverter.t>,InputVCFVer=<1.1.0>>
##SAMPLE=<ID=NORMAL,Description="Normal",Accession=45,Platform=HiSeq,Protocol=genomic,SampleName=PD1234b,Source=ID_SAMPLE_COSMIC,Study=12346>
##SAMPLE=<ID=TUMOUR,Description="Mutant",Accession=123,Platform=HiSeq,Protocol=genomic,SampleName=PD1234a,Source=ID_SAMPLE_COSMIC,Study=12345>
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NORMAL TUMOUR
Expand Down
Loading

0 comments on commit 0a05193

Please sign in to comment.