Entering edit mode
7.0 years ago
Arindam Ghosh
▴
530
I need help regarding a perl code that was used to count the numbr of bases. I am aware of the function of cat and grep commands here. But the perl portion of the code is a bit puzzling.
> cat chr22_with_ERCC92.fa | grep -v ">" | perl -ne 'chomp $_; $bases{$_}++ for split //; if (eof){print "$_ $bases{$_}\n" for sort keys %bases}'
And what about the
statement. Is it used for for looping? Usually the syntax is
Is this an alternate way of using it?