Skip to content

Commit 165ec56

Browse files
author
am26
committed
Merge branch 'release/2.0.6'
2 parents 7499ab4 + b0051e1 commit 165ec56

11 files changed

+253
-31
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
/README.md
99
/perl/MYMETA.json
1010
/perl/MYMETA.yml
11+
/perl/docs/
12+
/perl/perltidy.LOG

perl/MANIFEST

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
bin/compare_CN_and_fusion.pl
2+
bin/compare_overlapping_fusions.pl
3+
bin/defuse.pl
4+
bin/filter_fusions.pl
5+
bin/process_qcstats.pl
6+
bin/star_fusion.pl
7+
bin/star_mapping.pl
8+
bin/tophat_add_strand.pl
9+
bin/tophat_fusion.pl
10+
config/defuse.ini
11+
config/star.ini
12+
config/tophat.ini
13+
docs.tar.gz
14+
docs/pod_html/_blkbluw.css
15+
docs/pod_html/_blkcynw.css
16+
docs/pod_html/_blkgrng.css
17+
docs/pod_html/_blkmagw.css
18+
docs/pod_html/_grygrnk.css
19+
docs/pod_html/_grygrnw.css
20+
docs/pod_html/_podly.js
21+
docs/pod_html/_whtgrng.css
22+
docs/pod_html/_whtnavk.css
23+
docs/pod_html/_whtprpk.css
24+
docs/pod_html/_whtpurk.css
25+
docs/pod_html/compare_overlapping_fusions.html
26+
docs/pod_html/defuse.html
27+
docs/pod_html/filter_fusions.html
28+
docs/pod_html/index.html
29+
docs/pod_html/star_fusion.html
30+
docs/pod_html/star_mapping.html
31+
docs/pod_html/tophat_add_strand.html
32+
docs/pod_html/tophat_fusion.html
33+
docs/reports_html/common.js
34+
docs/reports_html/cover.14
35+
docs/reports_html/cover.css
36+
docs/reports_html/coverage.html
37+
docs/reports_html/css.js
38+
docs/reports_html/index.html
39+
docs/reports_html/lib-Sanger-CGP-CgpRna-pm--subroutine.html
40+
docs/reports_html/lib-Sanger-CGP-CgpRna-pm.html
41+
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm--branch.html
42+
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm--subroutine.html
43+
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm.html
44+
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm--branch.html
45+
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm--subroutine.html
46+
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm.html
47+
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm--branch.html
48+
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm--subroutine.html
49+
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm.html
50+
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm--branch.html
51+
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm--subroutine.html
52+
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm.html
53+
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm--branch.html
54+
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm--subroutine.html
55+
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm.html
56+
docs/reports_html/standardista-table-sorting.js
57+
docs/reports_text/coverage.txt
58+
lib/Sanger/CGP/CgpRna.pm
59+
lib/Sanger/CGP/CompareFusions/FusionAnnotation.pm
60+
lib/Sanger/CGP/CompareFusions/Implement.pm
61+
lib/Sanger/CGP/Defuse/Implement.pm
62+
lib/Sanger/CGP/RnaQC/Implement.pm
63+
lib/Sanger/CGP/Star/Implement.pm
64+
lib/Sanger/CGP/Tophat/Implement.pm
65+
Makefile.PL
66+
MANIFEST This list of files
67+
perltidy.LOG
68+
t/1_pm_compile.t
69+
t/2_pl_compile.t
70+
t/data/tst.txt

perl/Makefile.PL

-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434

3535
use ExtUtils::MakeMaker;
36-
use File::ShareDir::Install;
3736

3837
WriteMakefile(
3938
NAME => 'cgpRna',
@@ -50,6 +49,3 @@ WriteMakefile(
5049
'File::Which' => 1.09,
5150
}
5251
);
53-
54-
package MY;
55-
use File::ShareDir::Install qw( postamble );

perl/docs.tar.gz

87.7 KB
Binary file not shown.

perl/lib/Sanger/CGP/CgpRna.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use strict;
3636
use Const::Fast qw(const);
3737
use base 'Exporter';
3838

39-
our $VERSION = '2.0.4';
39+
our $VERSION = '2.0.6';
4040
our @EXPORT = qw($VERSION);
4141

4242
1;

perl/lib/Sanger/CGP/Star/Implement.pm

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const my $STAR => q{ %s %s --readFilesIn %s };
6262
const my $STAR_FUSION => q{ %s --chimeric_out_sam %s --chimeric_junction %s --ref_GTF %s --min_novel_junction_support 10 --min_alt_pct_junction 10.0 --out_prefix %s };
6363
const my $SAMTOBAM => q{ view -bS %s > %s };
6464
const my $BAMSORT => q{ I=%s fixmate=1 inputformat=bam level=1 tmpfile=%s/tmp O=%s inputthreads=%s outputthreads=%s};
65+
const my $HD_LINE => '@HD VN:1.4 SO:unsorted';
6566

6667
sub check_input {
6768
my $options = shift;
@@ -332,6 +333,7 @@ sub process_star_params {
332333
$cfg->setval($STAR_DEFAULTS_SECTION, 'outSAMattrRGline', $options->{'rgline'}) if(defined $options->{'rgline'});
333334
$cfg->setval($STAR_DEFAULTS_SECTION, 'outSAMheaderCommentFile', $options->{'commentfile'}) if(defined $options->{'commentfile'});
334335
$cfg->setval($STAR_DEFAULTS_SECTION, 'quantMode', 'TranscriptomeSAM') unless(defined $fusion_mode);
336+
$cfg->setval($STAR_DEFAULTS_SECTION, 'outSAMheaderHD', $HD_LINE);
335337

336338
my @star_command;
337339
my @star_defaults = $cfg->Parameters($STAR_DEFAULTS_SECTION);

perl/t/1_pm_compile.t

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# this is a catch all to ensure all modules do compile
2+
# added as lots of 'use' functionality is dynamic in pipeline
3+
# and need to be sure that all modules compile.
4+
# simple 'perl -c' is unlikely to work on head scripts any more.
5+
6+
use strict;
7+
use Data::Dumper;
8+
use Test::More;
9+
use List::Util qw(first);
10+
use File::Find;
11+
use Cwd;
12+
use Try::Tiny qw(try finally);
13+
use File::Spec;
14+
15+
use FindBin qw($Bin);
16+
my $lib_path = "$Bin/../lib";
17+
18+
# Add modules here that cannot be instantiated (should be extended and have no 'new')
19+
# or need a set of inputs - these should be tested in own test script
20+
use constant MODULE_SKIP => qw();
21+
22+
23+
my $init_cwd = getcwd;
24+
25+
my @modules;
26+
try {
27+
chdir($lib_path);
28+
find({ wanted => \&build_module_set, no_chdir => 1 }, './');
29+
} finally {
30+
chdir $init_cwd;
31+
die "The try block died with: @_\n" if(@_);
32+
};
33+
34+
for my $mod(@modules) {
35+
use_ok($mod) or BAIL_OUT("Unable to 'use' module $mod");
36+
}
37+
38+
for my $mod(@modules) {
39+
ok($mod->VERSION, "Check version inheritance exists ($mod)");
40+
if($mod->can('new')) { # only try new on things that have new defined
41+
new_ok($mod) unless( first {$mod eq $_} MODULE_SKIP );
42+
}
43+
}
44+
45+
done_testing();
46+
47+
sub build_module_set {
48+
if($_ =~ m/\.pm$/) {
49+
50+
my ($dir_str,$file) = (File::Spec->splitpath( $_ ))[1,2];
51+
$file =~ s/\.pm$//;
52+
my @dirs = File::Spec->splitdir( $dir_str );
53+
shift @dirs;
54+
push @modules, (join '::', @dirs).$file;
55+
}
56+
}

perl/t/2_pl_compile.t

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# this is a catch all to ensure all modules do compile
2+
# added as lots of 'use' functionality is dynamic in pipeline
3+
# and need to be sure that all modules compile.
4+
# simple 'perl -c' is unlikely to work on head scripts any more.
5+
6+
use strict;
7+
use Data::Dumper;
8+
use Test::More;
9+
use List::Util qw(first);
10+
use Try::Tiny qw(try catch);
11+
use autodie qw(:all);
12+
use File::Find;
13+
14+
use FindBin qw($Bin);
15+
my $script_path = "$Bin/../bin";
16+
17+
use constant COMPILE_SKIP => qw();
18+
19+
my $perl = $^X;
20+
21+
my @scripts;
22+
find({ wanted => \&build_path_set, no_chdir => 1 }, $script_path);
23+
24+
for(@scripts) {
25+
my $script = $_;
26+
if( first {$script =~ m/$_$/} COMPILE_SKIP ) {
27+
note("SKIPPING: Script with known issues: $script");
28+
next;
29+
}
30+
my $message = "Compilation check: $script";
31+
my $command = "$perl -c $script";
32+
my ($pid, $process);
33+
try {
34+
$pid = open $process, $command.' 2>&1 |';
35+
while(<$process>){};
36+
close $process;
37+
pass($message);
38+
}
39+
catch {
40+
fail($message);
41+
};
42+
}
43+
44+
done_testing();
45+
46+
sub build_path_set {
47+
push @scripts, $_ if($_ =~ m/\.pl$/);
48+
}

perl/t/data/tst.txt

Whitespace-only changes.

prerelease.sh

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
set -eu # exit on first error or undefined value in subtitution
4+
set -o pipefail
5+
6+
# get current directory
7+
INIT_DIR=`pwd`
8+
9+
# get location of this file
10+
MY_PATH="`dirname \"$0\"`" # relative
11+
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
12+
if [ -z "$MY_PATH" ] ; then
13+
# error; for some reason, the path is not accessible
14+
# to the script (e.g. permissions re-evaled after suid)
15+
echo Failed to determine location of script >2
16+
exit 1 # fail
17+
fi
18+
# change into the location of the script
19+
cd $MY_PATH/perl
20+
rm -rf blib
21+
rm -rf docs
22+
23+
echo '### Running perl tests ###'
24+
25+
export HARNESS_PERL_SWITCHES=-MDevel::Cover=-db,reports,-ignore,'t/.*\.t'
26+
mkdir -p docs/reports_text
27+
prove -w -I lib
28+
echo
29+
echo '### Generating test/pod coverage reports ###'
30+
# removed 'condition' from coverage as '||' 'or' doesn't work properly
31+
cover -coverage branch,subroutine,pod -report_c0 50 -report_c1 85 -report_c2 100 -report html_basic reports -silent
32+
cover -coverage branch,subroutine,pod -report text reports -silent > docs/reports_text/coverage.txt
33+
rm -rf reports/structure reports/digests reports/cover.13 reports/runs
34+
cp reports/coverage.html reports/index.html
35+
mv reports docs/reports_html
36+
unset HARNESS_PERL_SWITCHES
37+
38+
echo '### Generating POD ###'
39+
mkdir -p docs/pod_html
40+
perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' lib:bin docs/pod_html > /dev/null
41+
42+
echo '### Archiving docs folder ###'
43+
tar cz -f docs.tar.gz docs
44+
45+
# generate manifest, and cleanup
46+
echo '### Generating MANIFEST ###'
47+
# delete incase any files are moved, the make target just adds stuff
48+
rm -f MANIFEST
49+
# cleanup things which could break the manifest
50+
rm -rf install_tmp
51+
perl Makefile.PL > /dev/null
52+
make manifest &> /dev/null
53+
rm -f Makefile MANIFEST.bak pm_to_blib MYMETA.*
54+
55+
# change back to original dir
56+
cd $INIT_DIR

setup.sh

+18-26
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,8 @@ cd $INIT_DIR
124124

125125
# make sure that build is self contained
126126
unset PERL5LIB
127-
ARCHNAME=`perl -e 'use Config; print $Config{archname};'`
128127
PERLROOT=$INST_PATH/lib/perl5
129-
PERLARCH=$PERLROOT/$ARCHNAME
130-
export PERL5LIB="$PERLROOT:$PERLARCH"
128+
export PERL5LIB="$PERLROOT"
131129

132130
# Set PYTHONPATH as well so that RSeQC can be installed
133131
unset PYTHONPATH
@@ -171,15 +169,12 @@ if [ -e $SETUP_DIR/star.success ]; then
171169
else
172170
(
173171
cd $SETUP_DIR
174-
set -x
175-
if [ ! -e star ]; then
176-
get_distro "star" $SOURCE_STAR
177-
mkdir -p star
178-
tar --strip-components 1 -C star -zxf star.tar.gz
179-
fi
180-
cp star/bin/Linux_x86_64/STAR $INST_PATH/bin/.
181-
cp star/STAR-Fusion-*/STAR-Fusion $INST_PATH/bin/.
182-
cp star/STAR-Fusion-*/lib/* $PERLROOT/.
172+
get_distro "star" $SOURCE_STAR &&
173+
mkdir -p star &&
174+
tar --strip-components 1 -C star -zxf star.tar.gz &&
175+
cp star/bin/Linux_x86_64/STAR $INST_PATH/bin/. &&
176+
cp star/STAR-Fusion-*/STAR-Fusion $INST_PATH/bin/. &&
177+
cp star/STAR-Fusion-*/lib/* $PERLROOT/. &&
183178
touch $SETUP_DIR/star.success
184179
)>>$INIT_DIR/setup.log 2>&1
185180
fi
@@ -193,14 +188,11 @@ if [ -e $SETUP_DIR/rseqc.success ]; then
193188
else
194189
(
195190
cd $SETUP_DIR
196-
set -x
197-
if [ ! -e rseqc ]; then
198-
get_distro "rseqc" $SOURCE_RSEQC
199-
mkdir -p rseqc
200-
tar --strip-components 1 -C rseqc -zxf rseqc.tar.gz
201-
fi
202-
cd $SETUP_DIR/rseqc
203-
python ./setup.py install --prefix=$INST_PATH
191+
get_distro "rseqc" $SOURCE_RSEQC &&
192+
mkdir -p rseqc &&
193+
tar --strip-components 1 -C rseqc -zxf rseqc.tar.gz &&
194+
cd $SETUP_DIR/rseqc &&
195+
python ./setup.py install --prefix=$INST_PATH &&
204196
touch $SETUP_DIR/rseqc.success
205197
)>>$INIT_DIR/setup.log 2>&1
206198
fi
@@ -227,11 +219,11 @@ done_message "" "Failed during installation of core dependencies."
227219
# Install cgpRna code
228220
echo -n "Installing cgpRna..."
229221
(
230-
cd $INIT_DIR/perl
231-
perl Makefile.PL INSTALL_BASE=$INST_PATH
232-
make
233-
make test
234-
make install
222+
cd $INIT_DIR/perl &&
223+
perl Makefile.PL INSTALL_BASE=$INST_PATH &&
224+
make &&
225+
make test &&
226+
make install &&
235227
cp $INIT_DIR/perl/config/star.ini $INST_PATH/config/
236228
) >>$INIT_DIR/setup.log 2>&1
237229
done_message "" "cgpRna install failed."
@@ -249,4 +241,4 @@ echo "Please add the following to beginning of PYTHONPATH:"
249241
echo " $PYTHONROOT"
250242
echo
251243

252-
exit 0
244+
exit 0

0 commit comments

Comments
 (0)