Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Splice an array into another array

by AnomalousMonk (Archbishop)
on Jun 23, 2017 at 23:35 UTC ( [id://1193422]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Splice an array into another array
in thread Splice an array into another array

... in the end I have to manually enter each nucleotide, am I understanding this right? In other words I can't be lazy and store several DNA files I downloaded online into arrays and then operate on them. For each of my array I have to manually type the nucleotide sequences in myself or copy+paste them in

You have to realize that when you read a file with | with a sequence of statements like
    $DNA3file = 'testDNA3';
    open(DNA3handle, $DNA3file);
    @DNA3 = <DNA3handle>;
the  @DNA3 array ends up with all the lines of the file, and each line is a string that looks like  "ATCCATGC\n" (note the newline that will be at the end of (almost) every line).

If you have the lines of the file as strings, you | your program can operate on them as strings, break them up into arrays and operate on them, etc., as appropriate for your application. Your choice.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: Splice an array into another array
by Smeb (Novice) on Jun 23, 2017 at 23:37 UTC

    nope, I didn't, but thanks for the explanation, I understand it much more clearly now! :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (9)
As of 2024-04-18 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found