Thanks Kevin,
   Yes, I had redefined count.

#function count(chr)
> #    # determines complement
> #    # where A -> C; C -> A; G -> T; T -> G
> #    # takes chr (from string), returns str
> #    if string(chr) == "A"
> #        return 1
> #    elseif string(chr) == "C"
> #        return 2
> #    elseif string(chr) == "G"
> #        return 3
> #    elseif string(chr) == "T"
> #        return 4
> #    end
> #end
>
   
which fully explains where the full string result came from...

Will add "check that you haven't redefined something to mental debugging 
list"...

Also, thanks for reviving knowledge that 'A' and "A" are not equivalent..

On Friday, August 8, 2014 6:17:21 PM UTC-5, Kevin Squire wrote:
>
> Hi Fredrick,
>
> This should work find, though not quite how you're using it:
>
> julia> count(c->(c=="A"), "ACTGA")
> 0
>
> julia> count(c->(c=='A'), "ACTGA")
> 2
>
> julia> "A" == 'A'
> false
>
> julia> "A"[1] == 'A'
> true
>
>
> In Julia, 'A' indicates the character A, and "A" indicates the length-1 
> string "A", and these are not equivalent.  
>
> Did you really get an answer of "ACTGA", or was that a typo?  If it wasn't 
> a typo, I'm guessing that you accidentally redefined "count", and that if 
> you restart julia, everything would work fine.
>
> Cheers,
>    Kevin
>

Reply via email to