/usr/share/ampliconnoise/Scripts/Qiime.pl is in ampliconnoise 1.29-7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | #!/usr/bin/perl
$listFile = shift(@ARGV);
$fastaFile = shift(@ARGV);
$d = shift(@ARGV);
my %fastaMap = {};
my $count = 1;
open(FASTAFILE, $fastaFile) or die "Can't open $fastaFile\n";
while($line = <FASTAFILE>){
chomp($line);
if($line=~/>(.*)/){
$fastaMap{$1} = $count;
$count++;
}
}
close(FASTAFILE);
@mapFiles = @ARGV;
my %readMap = {};
foreach $mapFile(@mapFiles)
{
my @map = ();
open (MAPFILE, $mapFile) or die "Can't open $mapFile\n";
while($line = <MAPFILE>){
chomp($line);
my @stokens = split(/ /,$line);
my @ctokens = split(/,/,$stokens[1]);
my @maptokens = ();
#$stokens[1]=~tr/,/\t/;
foreach $ctok(@ctokens){
# print "$ctok $fastaMap{$ctok}\n";
push(@maptokens,$fastaMap{$ctok});
}
push(@map,\@maptokens);
}
close(MAPFILE);
$mapFile=~/${mapDir}\/(.*)_S1000_s60_c01_T220_s30_c08_cd.mapping/;
$sample=$1;
$readMap{$sample} = \@map;
# print "$mapFile\n";
}
#foreach $sample (keys %readMap){
# print "$sample\n";
# my @array = @{$readMap{$sample}};
# my $tsize = scalar(@array);
# for($i = 0; $i < $tsize; $i++){
# my @finalidx = @{$array[$i]};
# print "$i @finalidx\n";
# }
#}
open(FILE, $listFile) or die "Can't open $file\n";
while($line = <FILE>){
chomp($line);
@tokens = split(/ /,$line);
$locald = shift(@tokens);
if($d == $locald){
$N = shift(@tokens);
for($i = 0; $i < $N; $i++){
print "$i\t";
my @clust = split(/,/,$tokens[$i]);
my @temp = ();
foreach $read (@clust){
$read=~/(TS\d+).*_(\d+)_\d+/;
my $sample = $1;
my $idx = $2;
my @array = @{$readMap{$sample}};
my @finalidx = @{$array[$idx]};
# print "$sample $idx @finalidx\n";
foreach my $c(@finalidx){
# print "$sample\n";
push(@temp,"${sample}_${c}");
}
}
my $tempString = join("\t",@temp);
print "$tempString\n";
}
}
}
close(FILE);
|