Help for this page

Select Code to Download


  1. or download this
    #read IDs into %edges using match operator /(\S*)(\t)(\S*)/ and specia
    +l variables $1, $3 for each ID per line
    #assign IDs as format $edge{ID1,ID2}
    ...
    #go through %edges and increment %counter for each ID
    #generate random network with rand(int(scalar(@uniqIDs))), discard ran
    +dom picks if they already exist or represent undirected equivalent
    #initialize random network degree counter hash, and then count random 
    +network degrees as before
    
  2. or download this
    my $filename = "edges.txt";   #Set a variable for our file name
    open(my $fh, "<", $filename) or die "Can't open file $filename.";  #Op
    +en the file edges.txt
    ...
    close $fh;   #Close the file edges.txt
       my @list = keys %uniqedge;
       print "@list\n";          #Prints the list of keys, but they are un
    +i-directional (i.e. repeated for ID1-ID2 and ID2-ID1)