Hi,

I am trying to match the location of the list of string  like this

    library(seqinr)

    at <- ("ATATATAT")
    s1 <-ifelse(at[8]=="T"||"A" && at[7]=="A"||"T" &&
                at[6]=="T"||"A",5,
                ifelse(at[2]=="T"||"A" && at[4]=="A"||"T" &&
                         at[1]=="T"||"A",'1','0'
                ))
    s1

It works fine only for one sequence. I tried it in a for loop but getting error like 

    invalid 'x' type in 'x && y'

Any help is much appreciated
Thanks

To simplify your example, condition: if any 2nd or 4th position in every sequence has A or T, then TRUE.

    # example data
    x <- c("AAGTA", 
           "AAGTA", 
           "AAGTA", 
           "ACGAA")
    
    # in this example all TRUE
    all(substr(x, 2, 2) %in% c("A", "T") | substr(x, 4, 4) %in% c("A", "T"))
    # [1] TRUE

If this is not the solution you are looking for, then please provide example input and expected output, clearly.