Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Count the sequence length of each entry in the file

by kcott (Bishop)
on Oct 03, 2020 at 04:47 UTC ( #11122503=note: print w/replies, xml ) Need Help??


in reply to Re^2: Count the sequence length of each entry in the file
in thread Count the sequence length of each entry in the file

"for the first entry, the sequence length value you get in your output (110) is one less than the actual sequence length which is 111."
$ perl -E 'say length "VQLQESGGGLVQAGGSLRLSCAASGRAVSMYNMGWFRQAPGQERELV +AAISRGGSIYYA"' 59 $ perl -E 'say length "DSVKGRFTISRDNAKNTLYLQMNNLKPEDTGVYQCRQGSTLGQGTQV +TVSS"' 51 $ perl -E 'say 59+51' 110

If you add the newline between those two strings you'll get 111 for \n or 112 for \r\n. There's also whitespace after those strings which will further increase the length of the line. As I already stated, you posted your data as paragraph text: I can't tell what the original data was.

I removed all whitespace in my code:

$record =~ s/\s//gm;

The correct length, after removing white space, is 110.

— Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11122503]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2020-11-30 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?