# HG changeset patch # User elixir-it # Date 1595508842 0 # Node ID c68401961b4bccab773d2cb8d97a9617ab60951d Uploaded diff -r 000000000000 -r c68401961b4b join_nucmer/join_nucmer.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/join_nucmer/join_nucmer.pl Thu Jul 23 12:54:02 2020 +0000 @@ -0,0 +1,55 @@ +@genomes=(); +$ofile=shift; +open(OUT,">$ofile"); +foreach $f (@ARGV) +{ + open(IN,$f); + %ldata=(); + $genome=""; + while() + { + chomp(); + ($pos,$b1,$b2,$gen)=(split(/\s+/))[1,2,3,-1]; + next unless $b1=~/[ACTG]/ && $b2=~/[ACTG]/; + $ldata{$pos}=[$b1,$b2]; + if ($genome eq "") + { + $genome=$gen; + push(@genomes,$genome); + } + } + $prev_pos=0; + $prev_ref="na"; + $prev_alt="na"; + foreach $pos (sort{$a<=>$b} keys %ldata) + { + $dist=$pos-$prev_pos; + if ($dist>1) + { + $pos_append=$prev_pos-length($prev_alt)+1; + $dat_final{"$pos_append\_$prev_ref|$prev_alt"}{$genome}=1 unless $prev_ref eq "na"; + $prev_ref=$ldata{$pos}[0]; + $prev_alt=$ldata{$pos}[1]; + }else{ + $prev_ref.=$ldata{$pos}[0]; + $prev_alt.=$ldata{$pos}[1]; + } + $prev_pos=$pos; + } + $pos_append=$prev_pos-length($prev_alt)+1; + $dat_final{"$pos_append\_$prev_ref|$prev_alt"}{$genome}=1 if $prev_ref ne "na"; + +} + +print OUT " @genomes\n"; +foreach $pos (sort{$a<=>$b} keys %dat_final) +{ + $line="$pos "; + foreach $g (@genomes) + { + $val=$dat_final{$pos}{$g} ? 1 : 0; + $line.="$val "; + } + chop($line); + print OUT "$line\n"; +} diff -r 000000000000 -r c68401961b4b join_nucmer/join_nucmer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/join_nucmer/join_nucmer.xml Thu Jul 23 12:54:02 2020 +0000 @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + **What it does?** + + This tool is used to merge variant calls, in nucmer format, into a single tabular file. The output file will have as may columns as + the number of genomes provided in input. And as many rows as the number of variants observed in the genomes. For every genome assembly and + variant a simple binary code 1= present, 0=absent will be used to indicate whether that genome carries a specific variant. + This table should be provided to the FunAnn tool to obtain the functional annotation of the variants. + + + + + + + + +