Showing posts with label PERL. Show all posts
Showing posts with label PERL. Show all posts

Thursday, November 16, 2017

biogrid tab2 clean, perl code


FILE:  1.clean.tab2.20171115.pl


#! /usr/bin/perl

# usage:
# ~/pypeworks/biogrid/00_cleanup_biogrid_table.pl  BIOGRID-ORGANISM-Homo_sapiens-3.2.117.tab2.txt > BIOGRID-ORGANISM-Homo_sapiens-3.2.117.tab2.clean.txt
# can use bash to apply it to more species as needed

while ( <>) {
    chomp;
    @aux = split "\t";
    @new = ();
    foreach (@aux) {
        $blah = $_;
        $blah =~ s/\s//g;
        ($blah eq '-') && ($blah='');
        if (! $blah) {
            push @new, 'NA';
        } else {
            # somebody in BioGRID thought it would be cute to use backslash
            # as quotes
            $blah = $_;
            $blah =~ s/\\//g;
            push @new, $blah;
        }
    }
    
    print join ("\t", @new), "\n";

}

Based on 
https://github.com/ivanamihalek/biogrid/blob/master/00_cleanup_biogrid_table.pl 

Wednesday, January 20, 2016

tar backup byte laptop


lapphy-pc1:~ hqin$ cat backup.byte.sh 

date
 echo "Back up Byte laptop  now"
 time perl /Users/hqin/perl/backup4.pl /Volumes/bear/byte > /tmp/_backup.hqin.txt 


date

lapphy-pc1:~ hqin$ sh backup.byte.sh 
Wed Jan 20 20:23:37 EST 2016
Back up Byte laptop  now
defined(%hash) is deprecated at /Users/hqin/lib/perl/Util.pm line 610.
(Maybe you should just omit the defined()?)

du: Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState: Permission denied
tar: wdijk-112507/trash: Couldn't visit directory: Permission denied
tar: wdijk-112507/doc: Couldn't visit directory: Permission denied
tar: day2.tab: could not open file: Permission denied
tar: day3.tab: could not open file: Permission denied
tar: day4.tab: could not open file: Permission denied
tar: Error exit delayed from previous errors.
tar: Google: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.

real 82m9.817s
user 0m9.009s
sys 5m13.683s


Wed Jan 20 21:45:47 EST 2016