#!/usr/bin/perl -w # # separador.pl # # separa per cromosomes # # bmorancho & jplanas - UPF - 2002/02/28 # use strict; my $PROG = "$0"; my $s; if (scalar(@ARGV < 1)) { print "USAGE: $PROG \n"; exit (1); return; }; my $crom_name_file = "seqs".$ARGV[0].".txt"; open(SEQS, "< refseq.gff"); open(CROM, "> $crom_name_file"); while () { if ($. % 500 == 0) {print STDERR "."} next if /^\d+\s*\t*$/o; next if /random\t/o; next if /^\s*$/o; # skip empty lines my @f = split/\t/,$_; $f[0] = substr($f[0],3); if ($f[0] eq "X") {$f[0] = 23;}; if ($f[0] eq "Y") {$f[0] = 24;}; next if $f[0] != $ARGV[0]; print CROM $_; $s = $.; next; }; print "[$s]\n"; close(SEQS); close(CROM); my $snp_name_file = "snp".$ARGV[0].".txt"; open(SNPS, "< snpNih.txt"); open(CROM, "> $snp_name_file"); while () { if ($. % 5000 == 0) {print STDERR "."} next if /^\d+\s*\t*$/o; next if /random\t/o; next if /^\s*$/o; # skip empty lines my @f = split/\t/,$_; $f[1] = substr($f[1],3); if ($f[1] eq "X") {$f[1] = 23;}; if ($f[1] eq "Y") {$f[1] = 24;}; next if $f[1] != $ARGV[0]; print CROM $_; $s = $.; next; }; print "[$s]\n"; close(SNPS); close(CROM); # # END