Skip to content

Commit

Permalink
Added more information about SNP filtering and processing to the manual
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKrueger committed Jul 18, 2016
1 parent 10bf621 commit 93d5b81
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
Binary file modified SNPsplit_User_Guide.pdf
Binary file not shown.
10 changes: 8 additions & 2 deletions SNPsplit_genome_preparation
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ my %snps; # storing all filtered SNPs
my %snps_dual_genome; # storing all SNPs for dual genome

my $snp_file_strain = "all_SNPs_${strain}_GRCm38.txt.gz";
my $snp_file_strain2 = "all_SNPs_${strain2}_GRCm38.txt.gz";
my $snp_file_strain2;
if ($strain2){
$snp_file_strain2 = "all_SNPs_${strain2}_GRCm38.txt.gz";
}
else{
$snp_file_strain2 = 'irrelevant_for_single_hybrid_mode';
}
my $new_ref_snp_annoations; # this will store the new Ref/SNP annotations for dual hybrids

warn "Summarising SNPsplit Genome Preparation Parameters\n";
Expand Down Expand Up @@ -993,7 +999,7 @@ sub detect_strains{
my @strains = split (/\t/);

foreach my $index(0..$#strains){
next if ($index <= 8); # The first 6 fields are irrelevant: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
next if ($index <= 8); # The first 8 fields are irrelevant: #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
$strains{$strains[$index]} = $index;
# warn "$index\t$strains[$index]\n";
}
Expand Down
44 changes: 44 additions & 0 deletions copy_SNPsplit_files_for_release.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/perl
use warnings;
use strict;
use File::Copy "cp";

my $dir = shift@ARGV;

die "Please provide a directory to copy files to!\n\n" unless ($dir);

unless (-d $dir){
warn "Specified directory '$dir' doesn't exist. Creating it for you...\n\n";
mkdir $dir or die "Failed to create directory: $!\n\n";
}

my @files = ('RELEASE_NOTES.txt','SNPsplit','tag2sort','SNPsplit_User_Guide.pdf','license.txt','SNPsplit_genome_preparation');

foreach my $file (@files){
copy_and_warn($file);
}

sub copy_and_warn{
my $file = shift;
warn "Now copying '$file' to $dir\n";
cp($file,"$dir/") or die "Copy failed: $!";

}

@files = ('SNPsplit','tag2sort','SNPsplit_genome_preparation');

foreach my $file (@files){
set_permissions($file);
}

sub set_permissions{
my $file = shift;
warn "Setting permissions for ${dir}/$file\n";
chmod 0755, "${dir}/$file";
}


### Taring up the folder
$dir =~ s/\/$//;
warn "Tar command:\ntar czvf ${dir}.tar.gz $dir\n\n";
system ("tar czvf ${dir}.tar.gz $dir/");

0 comments on commit 93d5b81

Please sign in to comment.