Sequence similarity and evidence for homology

Practical 4: Genomics, systems biology and multi-omics

Learning objectives

Compute aligned identity with a stated denominator; explore a composition-preserving shuffle comparison; distinguish similarity, homology and function.

Biological question and data

Does a high number of matching bases provide enough evidence to claim common ancestry or shared function?

Two supplied short sequences are compared at corresponding positions without gaps. A shuffle calculation conditions on one sequence’s base composition; it is a restricted teaching null, not BLAST or an evolutionary test.

No biological download is required. Numerical inputs are hypothetical, not observed animal data. The runnable examples use base R. Count and abundance units are specified where used.

1. Measure identity

The sequences have equal length. Record both matches and denominator.

Show R code
a <- strsplit("ACGTACGTACGTACGT","")[[1]]
b <- strsplit("ACGTACGTTCGTACGA","")[[1]]
stopifnot(length(a)==length(b))
observed <- sum(a==b)
c(matches=observed,length=length(a),identity=observed/length(a))
 matches   length identity 
  14.000   16.000    0.875 
Show R code
stopifnot(observed==14)

Fourteen of sixteen corresponding bases match in this supplied alignment.

2. Compare a restricted shuffle null

Shuffle the second sequence without changing composition. Include the usual plus-one Monte Carlo tail convention.

Show R code
set.seed(401)
shuffled <- replicate(499,sum(a==sample(b)))
p_mc <- (1+sum(shuffled>=observed))/(length(shuffled)+1)
c(shuffle_mean=mean(shuffled),observed=observed,shuffle_tail=p_mc)
shuffle_mean     observed shuffle_tail 
    4.084168    14.000000     0.002000 
Show R code
hist(shuffled,breaks=seq(-.5,16.5,1),xlab="Matches under composition shuffle",main="Restricted teaching null")
abline(v=observed,col="#d95f02",lwd=2)

This comparison shows what positional matches look like after a particular randomization. It ignores database size, local-alignment selection, substitution models and sequence dependence.

3. Separate claims

Place each claim beside the extra evidence it needs.

Show R code
claims <- data.frame(claim=c("sequence similarity","homology","shared function"),
 evidence=c("explicit aligned comparison","ancestry inference with appropriate context",
 "functional/domain/experimental evidence"))
claims
                claim                                    evidence
1 sequence similarity                 explicit aligned comparison
2            homology ancestry inference with appropriate context
3     shared function     functional/domain/experimental evidence

Homology is a relationship of common ancestry, not 87.5% homology. Shared function is a further biological claim.

4. Compare complexity as well as identity

A composition-preserving shuffle of an all-A sequence always produces the same sequence. High identity in that case supplies no unusual positional agreement under this restricted null.

Show R code
low_complexity <- rep('A',16)
set.seed(404)
null_matches <- replicate(100,sum(low_complexity==sample(low_complexity)))
c(identity=1,null_mean=mean(null_matches),
 tail=(1+sum(null_matches>=16))/(length(null_matches)+1))
 identity null_mean      tail 
        1        16         1 
Show R code
stopifnot(all(null_matches==16))

5. Recognize search selection

The earlier comparison used one supplied alignment. A database search selects promising local regions from many candidates. Its significance calculation must account for its scoring and search setting; the toy shuffle tail omits that selection. Changing sequence length, complexity or database size can change the meaning of the same identity percentage.

A useful result description gives matches, comparable positions, coverage and comparison context. A functional claim additionally needs domain, evolutionary and experimental evidence. Do not replace that evidence with the word homology expressed as a percentage.

Interpretation challenge

Would increasing the number of shuffles make the toy tail a BLAST E-value?

No. More draws improve Monte Carlo resolution for the same restricted null. They do not add the database-search scoring and selection model needed for an E-value.

Interpretation and limits

Use the NCBI BLAST glossary to distinguish identity and homology. The toy shuffle tail is not a database-search E-value and cannot be substituted for one.

Exercises

  1. Compare two all-A sequences. Why is high identity weak evidence here?
  2. What is ignored by positional comparison when lengths differ?
  3. Does a small shuffle tail establish function?
  1. Low complexity makes agreement unsurprising; the composition-preserving shuffle gives the same matches.
  2. Alignment, indels and local-versus-global coverage must be specified.
  3. No; it addresses only the stated restricted null.

Continue learning

B05 Genomics.

Continue with alignment. Return to the practical index or the unified map.