forked from tangerzhang/ALLHiC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26a0395
commit 3d49400
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/perl -w | ||
### Convert ALLHiC output AGP file to ALLMAPS input csv file | ||
print "Convert ALLHiC output AGP file to ALLMAPS input csv file\n"; | ||
die "Usage: perl $0 groups.agp\n" if(!defined $ARGV[0]); | ||
|
||
my $agp = $ARGV[0]; | ||
open(OUT, "> hic.csv") or die""; | ||
print OUT "Scafffold ID,scaffold position,LG,genetic position\n"; | ||
open(IN, "grep -v 'contig' $agp|") or die""; | ||
while(<IN>){ | ||
chomp; | ||
my @data = split(/\s+/,$_); | ||
if($data[8] eq "+"){ | ||
$a = $data[6]; $b = $data[7]; | ||
}elsif($data[8] eq "-"){ | ||
$a = $data[7]; $b = $data[6]; | ||
} | ||
print OUT "$data[5],$a,$data[0],$data[1]\n"; | ||
print OUT "$data[5],$b,$data[0],$data[2]\n"; | ||
} | ||
close IN; | ||
close OUT; | ||
|