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

https://github.com/mengwu1002/Multi-taxon_analysis_pipeline
03 February 2021, 21:27:56 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • ecea61e
  • /
  • scripts
  • /
  • normalize_processed_filter.pl
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:91a0d50e0296dada22d8cb40ccbcf2c8012eced3
origin badgedirectory badge Iframe embedding
swh:1:dir:c5e796b659dfb63409b0c926433acfcd260b7e8a
origin badgerevision badge
swh:1:rev:fac437a7d35ecfd53600ff4dc667563dfb251d25
origin badgesnapshot badge
swh:1:snp:c60505b7b49a2230f60dcc86b1379799915750a1

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
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: fac437a7d35ecfd53600ff4dc667563dfb251d25 authored by Meng Wu on 15 October 2015, 16:36:34 UTC
Launch of the multi-taxon INSeq analysis pipeline
Tip revision: fac437a
normalize_processed_filter.pl
#!usr/bin/perl -w -s

#11/2/09
#per-sample count per million normalization on processed mapping output data
#06/12/2013
#
#input file format:
#SampleID \t chromosome \t Coordinate \t L_read \t R_read \t Total_reads \n
#04/09/2015
#Adjusted the cutoff to 3


if (!@ARGV){
  print "\nUsage: perl $0 <input.txt>\n";
  exit;
}


open IN, "$ARGV[0]";
open OUT, ">$ARGV[0]_filter_cpm.txt";

my $logfile;
if ($ARGV[0]=~/(\w+\.scarf)/){
   $logfile=$1.".log";
}

open LOG,">>$logfile";
print LOG "SampleID\tRawReadsAfterFiltered\tCoverage\tScale factor\n";
#print OUT "SampleID\tLocation\tCPM-normalized count\n";

#read file into 2D hash
my $data; # $data->{sampleID}->{location} = count
my $sample;

while (my $line = <IN>){
  chomp $line;
  my @temp = split /\s+/, $line;
  $data->{$temp[0]}->{$temp[1]} = $temp[4];
}


  my @sites;
  my @counts;
  my @norm_counts;
  foreach my $chromosome (keys %$data){ 
    foreach my $location (keys %{$data->{$chromosome}}){  #for each location within that sampleID
      if ($data->{$chromosome}->{$location}>=3){
        push (@sites, $location);
        push (@counts, $data->{$chromosome}->{$location});
      }
    }
  }
  my $sum=0;
  my $coverage=scalar @sites;
  for (my $i=0; $i<scalar @sites; $i++){
    $sum = $sum+$counts[$i];
  }
  my $scale_factor = 1000000/$sum;
  print LOG "$ARGV[0]\t$sum\t$coverage\t$scale_factor\n";
  foreach my $chromosome (keys %$data){ 
    foreach my $location (keys %{$data->{$chromosome}}){  #for each location within that sampleID
              if ($data->{$chromosome}->{$location}>5){
                  print OUT"$chromosome\t$location\t".$data->{$chromosome}->{$location}*$scale_factor."\n";
              }
    }
  }

close LOG;

back to top

Software Heritage — Copyright (C) 2015–2025, 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