首页 > Written > 至今写的最长的Linux管道命令

至今写的最长的Linux管道命令

2009年8月27日 Galaxy 发表评论 阅读评论
ll -rt ./_log/*.o* |awk '{if($5==84){print $9}}'
 | perl -ne '/(GP.*Chr.*\.sh)/;print "$1\n";' 
 | while read a; do find . -name "$a" ;done 
 | while read ss; do qsub -l vf=280M -cwd $ss;done

……
原因嘛,有些计算节点默认的SHELL不是bash,如果没shell-bang就出错到STDOUT:

Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.

也有可能是其他原因,反正就这了……


后记,这样还是不行。也不知道计算节点的配置到底是出啥问题了。

后后记:结果嘛,# -S /bin/bash

Tags: , , , ,

Related posts

分类: Written 标签: , , , , 542 views
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
  1. Galaxy
    2009年10月29日14:55 | #1


    ll |grep -v '\.'| awk '{print $9}'|xargs -n 1 ./cal.sh
    grep '' *.len |sort|perl -alne 'print join("\t",split /\.len:/)' > all.alen

    #!/bin/bash
    echo $1
    #find $1/*.sp |xargs cat|wc -l|tee $1.wc
    find $1/*.sp |xargs cat|awk '{print $6}'|perl -lane 'END { print "$b" } $b+=$_'|tee $1.len
    #!/bin/bash
    echo $1
    find $1/*.soaplst|xargs awk {'print $3'}|xargs cat|awk '{print $6}'|perl -lane 'END { print "$b" } $b+=$_'|tee $1.len

    [回复]

  2. Galaxy
    2010年1月4日20:14 | #2
    find *.glflst.0|while read a;do b=`echo $a|sed -n 's/^\(.\{1,\}\)\.\w/\1/p'`;echo [$b];./t.pl $a > $b;done
    #!/usr/bin/perl -w
    use strict;
    use warnings;
    while (<>) {
            my $line=$_;
            my $name=(split /\//)[-1];
            #print $name;
            $name =~ /GP(\d+)_C.*\.glf/;
            next if $1 >=53;
            #print $1,"\t",$name;
            print $line;
    }

    [回复]

  3. Galaxy
    2010年1月6日04:21 | #3
    awk '{print $1}' ../chr.len \
    |while read a;do find ./$a/*.psnp\
    |perl -lane '/^(.+?)_(\d+)\.psnp/;$a=$2;$a="00".$a if length($a)==1;$a="0".$a if length($a)==2;$a="z" if length($a)==0;print "$a\t$_"'\
    |sort|awk '{print $2}'>>./$a.psnplst;done

    [回复]

  4. Galaxy
    2010年2月21日15:35 | #4


    find ./outI -name '*.soap'|while read a;do b=`basename $a`;c="$b\txx\t1\t100\t100\t222\t211\t233\t__FQ__\t$a";perl -e '$a=$ARGV[0];$a=~s/\\t/\t/g;$c=$ARGV[1];$c=~s#/2soap/#/1fqfilted/#;$c=~s/\.soap/\.fq/;$a=~s/__FQ__/$c/;print "$a\n"' $c $a;done

    效率有些差,但,这类东东本来就不要求效率……

    [回复]

  5. Galaxy
    2010年5月18日20:28 | #5
    find -name *.fq.gz|while read a;do b=`basename $a`;
    c=`perl -lae '$_=$ARGV[0];s/\.gz$//;print' $b`;
    echo $c;gzip -dc $a > ./0rawfqgz/$c;
    done &

    [回复]

  6. Galaxy
    2010年5月18日21:01 | #6
    awk '$10>100 {print $10}' /ifs1/GAG/watermelon/soapg45/soapg/soap/PE/100214_I646_FC617B1AAXX_L4_WATxozRANDIAAPE_1.fq.soap
     |perl -lane 'if ($_ < 200) {$a=$_-100} else {$a=200-$_} print "$a\t$_"'
     |perl -lane 'BEGIN {my %a} ($x)=split /\t/; ++$a{$x};
      {print "$_\t$a{$_}" for sort {$a <=> $b} keys %a};print "-"x80'

    这个,嘛,两句拼的……

    [回复]

  7. Galaxy
    2010年5月19日10:46 | #7
    perl -lane '@a=split /\t/;open I,"<soap.lst";@l=<I>;close I;
     @c=grep /$a[1]/,@l;print "[",$a[0],"]\t[",$a[1],"]\n",@c,"\n";
     open O,">>$a[0]/soaps.lst";print O @c;close O;' sample.lst
    perl -lane '@a=split /\t/;print $a[0],"\t",$a[1],"\n";
    open O,">$a[0]/run${a[0]}.sh";
    print O "#\$ -cwd -r y -l vf=500M\n#\$ -o $a[0]/l.log -e $a[0]/l.err\n#\$ -v PERL5LIB,PATH,PYTHONPATH,LD_LIBRARY_PATH\n./soapInDel -s $a[0]/soaps.lst -f /ifs1/GAG/population/project/Watermelon_population/watermelon_v2_888/watermelon.merge.fa -o $a[0]/indel-result.list";
    close O' sample.lst

    [回复]

  8. Galaxy
    2010年6月9日12:00 | #8

    话说,下面这还算单行命令么……

    perl -lane '
    BEGIN {	my ($last,%c)=($F[0]);}
    if ($F[0] eq $last) {
    	if (keys %c < 3) {
    		(undef,$gi)=split "\\|",$F[1];
    		unless ($c{$F[1]}) {
    			chomp($a = `./getinfo.sh $gi`) or chomp($a = `./getinfo0.sh $gi`);
    			splice @F,2,0,$a;
    			print join "\t",@F;
    		}
    		++$c{$F[1]};
    	}
    } else {
    	$last=$F[0];
    	%c=();
    	if (keys %c < 3) {
    		(undef,$gi)=split "\\|",$F[1];
    		chomp($a = `./getinfo.sh $gi`) or chomp($a = `./getinfo0.sh $gi`);
    		splice @F,2,0,$a;
    		print join "\t",@F;
    		++$c{$F[1]};
    	}
    }
    ' files/FC61L0PAAXX_L5_TUBhhsRBZDIAAPE_1.blast |les

    getinfo.sh:

    #!/bin/bash
    BLASTDB=/blast/BLASTDB/taxdb:/blast/BLASTDB/asndb /blast/bin/blastdbcmd -db nt -outfmt "%T|%S|%L|%t|%l" -target_only -entry $1

    getinfo0.sh:

    #!/bin/bash
    BLASTDB=/blast/BLASTDB/taxdb:/blast/BLASTDB/asndb /blast/bin/blastdbcmd -db nt -outfmt "%T|NA|NA|%t|%l" -target_only -entry $1

    [回复]

    Galaxy 回复:
    | 编辑

    perl -lane 'BEGIN {my %c} @a=split /\t/;$b=$a[2];
    @a=split /\|/,$b;$b=join "|",@a[0..2];++$c{$b};
    print join "\t",$F[0],$c{$b},$b; 
    END {print "-" x 80; print "$c{$_}\t$_" for sort {$a <=> $b} keys %c;}' FC61L0PAAXX_L5_TUBhhsRBZDIAAPE.out 
    |sort -n| tee FC61L0PAAXX_L5_TUBhhsRBZDIAAPE.stat

    嘛,写一行Perl就可以说服自己容忍未优化的代码存在。
    (这就是代码艺术家的矜持么……

    [回复]

评论分页
1 2 628
  1. 本文目前尚无任何 trackbacks 和 pingbacks.

Locations of visitors to this page