Pull Alignment Character Position
1
0
Entering edit mode
12.5 years ago
alphaace ▴ 40

Hi,

I use pairwise align to get the following:

> alignment <-pairwiseAlignment(pattern = canonical.protein, subject=protein.extracted)
> alignment
Global PairwiseAlignedFixedSubject (1 of 1)
pattern: [448]          DDWEIPDGQITVGQRIGSGSFGTVYKGKWHGDVAVKMLNVTAPTPQQLQAFKNEVGV...FMVGRGYLSPDLSKVRSNCPKAMKRLMAE  CLKKKRDERPLFPQILASIELLARSLPK 
subject:   [1]     DDWEIPDGQITVGQRIGSGSFGTVYKGKWHGDVAVKMLNVTAPTPQQLQAFKNEVGV...FMVGRGYLSPDLSKVRSNCPKAMKRLMAECLKKKRDERPLFPQILASIELLARSLPK 
score: -912.3752

I can then use as.character(pattern(alignment)) and as.character(subject(alignment)) to get the full string sequence. However, how do I ge tthe number 448 and 1 out of the object as an integer?? Thanks!

r bioconductor • 2.1k views
ADD COMMENT
0
Entering edit mode
12.5 years ago
Niek De Klein ★ 2.6k

In your question on stackoverflow you say you can make them to string. If you make a string out of the alignments you can use R's string functions: you can do substr(toString(pattern(alignment)), 448, 448) to get the 448th character. I'm not familiar with that library so there might be an inbuilt way that I don't know of. See http://www.statmethods.net/management/functions.html for string functions in R.

ADD COMMENT

Login before adding your answer.

Traffic: 2301 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6