Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • ecea61e
  • /
  • scripts
  • /
  • combine_files_INSEQ_insertions_reads.pl
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:c3f7d5b088c07906b31a05fb14ecf104e62d4073
directory badge
swh:1:dir:c5e796b659dfb63409b0c926433acfcd260b7e8a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
combine_files_INSEQ_insertions_reads.pl
#!/usr/bin/perl -w
#--------------------------------------------------------------------------#
#  Author: Meng Wu, the Gordon Lab, Washington University in St. Louis     #                                                                   
#                                                                          # 
#  Usage:                                                                  #
#       see Usage in the code                                              #
#                                                                          #
#  Contact: mengwu@wustl.edu                                               #
#--------------------------------------------------------------------------#

if (!@ARGV){
   print "Usage: perl $0 <the output files from the analysis pipeline, the mapped insertions binned to each gene>\n";
   exit;
}

my @experiment=@ARGV;
my $sample;
my @sample;
my $ratio;
my $insertion;

foreach my $file(@experiment){
        chomp $file;
        print "Get the files\n";
        if ($file=~m/(.*)\_filter\_cpm\.txt/){
          $sample=$1;
          push @sample,$sample;
          open FILE,$file;
          <FILE>;
          while (<FILE>){
             chomp;
             @temp=split /\t/,$_;
             $ratio->{$temp[0]}->{$sample}=$temp[2];
             $insertion->{$temp[0]}->{$sample}=$temp[1];
         }
    }
}

my $out1="summary_reads.txt";
my $out2="summary_insertions.txt";
open OUT1,">$out1";
open OUT2,">$out2";
sort @sample;
my @header;
push @header,"Gene";
foreach my $sample (@sample){
  #  if (defined $candidate->{$sample}){
           push @header,$sample;
  #  }
}
my $line=join "\t",@header;
print OUT1 "$line\n";
print OUT2 "$line\n";
shift @header;
foreach my $gene(sort keys %$ratio){
    my @out1;
    my @out2;
    push @out1,$gene;
    push @out2,$gene;
    foreach my $sample (@sample){
          push @out1,$ratio->{$gene}->{$sample};
          push @out2,$insertion->{$gene}->{$sample};
    }
    my $line1=join "\t",@out1;
    my $line2=join "\t",@out2;
    print OUT1 "$line1\n";
    print OUT2 "$line2\n";
}

close OUT1;
close OUT2;

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API