File: create_randompairs.pl

package info (click to toggle)
python-pairix 0.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 179,892 kB
  • sloc: ansic: 5,553; python: 1,207; sh: 602; perl: 464; makefile: 64
file content (27 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl

$nlines = shift @ARGV;
$i=0;
$chr=1;
$chr2=1;
$pos=int(rand(1000));
$pos2=int(rand(1000));
$nlines2 = sqrt($nlines);
$MAXCHR=25;
$MAXPOS=536000000;
while($i<$nlines){
  print "lalala\tchr$chr\t$pos\tchr$chr2\t$pos2\t+\t+\n";
  if(rand($nlines/10)<=1 && $chr<$MAXCHR){
     $chr++;
     $chr2=$chr;
     $pos=int(rand(1000));
     $pos2=int(rand(1000));
  }
  if(rand($nlines/50)<=1 && $chr2<$MAXCHR){
     $chr2++;
     $pos2=int(rand(1000));
  }
  $pos+=int(rand(3)) if $pos<$MAXPOS;
  $pos2+=int(rand(3)) if $pos2<$MAXPOS;
  $i++;
}