####APPLY localizador ON SINGLE CHROMOSOME FILES#### + BE CAREFUL!, all the next commands have to be executed using the right root. In this case all of them are referred to files saved at a folder called "realdata". + Check that the internal structure of the fields that form the different registers of the main data files (refseq.gff and snpNih.txt) . bash$ head -5 refseq.gff snpNih.txt ==> refseq.gff <== chr10 refseq cds 141296 141451 . + . NM_006624 chr10 refseq cds 152600 152761 . + . NM_006624 chr10 refseq cds 168242 168319 . + . NM_006624 chr10 refseq cds 168989 169081 . + . NM_006624 chr10 refseq cds 193975 194062 . + . NM_006624 ==> snpNih.txt <== 585 chr1 33352 33353 9493 585 chr1 34188 34189 708393 585 chr1 34596 34597 1064597 585 chr1 55249 55250 241830 587 chr1 268795 268796 12474 + Split the corresponding registers of each chromosome at the main file into different files containing each one only the registers of a single chromosome. The folders "chroms" and "snps" should be created before. bash$ gawk '{ print $0 > "chroms/"$1".gff" }' refseq.gff + Do the same to the SNPs. bash$ gawk '{ print $0 > "snps/"$2".txt" }' snpNih.txt + If you want to automate the execution of the "Localitzador" program, you shall use the next command line. bash$ ls -1 chroms/chr* | \ perl -ne 'm/^.*chr(.*)\.gff$/o && print "$1\n";' > chrlist.tbl + If you want to use the "for" command form the command-line, you should give a list of items. bash$ for chr in 1 2 3 4 5 6 7 8 9 10; do { echo "### Chromosome: $chr"; }; done; + However, if you want to read from a file, then you shall use the shell's "while" command. bash$ cat chrlist.tbl | while read chr; do { echo "### Executing Localitzador at chromosome: $chr" 1>&2 ; }; done; + You can apply it this way: bash$ cat chrlist.tbl | while read chr ; do { if [ -e snps/chr${chr}.txt -a -e chroms/chr${chr}.gff ]; then echo "### Executing Localitzador at chromosome: $chr" 1>&2 ; ../localitzador snps/chr${chr}.txt chroms/chr${chr}.gff \ > output/chr${chr}.tbl 2> output/chr${chr}.err ; else echo "### ERROR!!! Check files of chromosome: $chr" 1>&2 ; fi; } ; done ;