in reply to Re^4: Reduce RAM required
in thread Reduce RAM required

Does your input file have leading whitespace?

Also, program state is altered by the print statement, you can't have two of them.

Replies are listed 'Best First'.
Re^6: Reduce RAM required
by onlyIDleft (Scribe) on Jan 09, 2019 at 20:00 UTC
    head -n1 Ath_orig.fa >Chr1

    Doesn't appear to have any leading whitespace

    About the print statement, even if I comment out the first one, the output file is still empty

    Conversely, if I comment out the second one, I do not see the output on screen as STDOUT

    If you would like to replicate the same behavior with my input file, you can download it from here -

    https://www.filehosting.org/file/details/774814/Ath_orig.fa

    Thanks a lot!

      Just post about 20 lines here, enclosed in a code block, instead of using a posting service that requires an email address.

      Try adding an error message as an "else" part to the "if" test to see if there are any invalid lines in the input file.

        No leading whitespaces anywhere in input file. I just opened it with a text editor and checked

        But I just remembered that real life DNA sequences also often have N in addition to A/T/G/C. these have to be accounted for as well, right?

        However, in my input sequences, having Ns versus NOT having them did not appear to make a difference in my test runs using the following input example

        >Chr1 CCCTAAACCCTAAACCCTAAACCCTAAACCTCTGAATCCTTAATCCCTAAATCCCTAAAT >Chr2 TATGACGTTTAGGGACGATCTTAATGACGTTTAGGGTTTTATCGATCAGCGACGTAGGGA >Chr3 GTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTTAGGGTTT >Chr4 AACAAGGTACTCTCATCTCTTTACTGGGTAAATAACATATCAACTTGGACCTCATTCATA >Chr5 AACATGATTCACACCTTGATGATGTTTTTAGAGAGTTCTCGTGTGAGGCGATTCTTGAGG

        It'd be strange if it worked for you, because it is not working for me! Output file is always empty - whether it be with large file size, real-life input sequences, or small example ones like above, Or with or without N characters, in addition to the A, C, G, T

        For example above, I even changed window length to 10

        I'm not sure what is happening! Perhaps you can share the code that works with this example (script version using in and out file handles)

        Sorry for the bother, but thanks