# Subset example data to one sample as a demo
data(ExampleDb, package="alakazam")
db <- subset(ExampleDb, SAMPLE == "-1h")
# Use genotyped V assignments, HS1F model, and normalize by junction length
dist_hs1f <- distToNearest(db, vCallColumn="V_CALL_GENOTYPED",
model="hs1f", first=FALSE, normalize="length")
# Plot histogram of non-NA distances
p1 <- ggplot(data=subset(dist_hs1f, !is.na(DIST_NEAREST))) + theme_bw() +
ggtitle("Distance to nearest: hs1f") + xlab("distance") +
geom_histogram(aes(x=DIST_NEAREST), binwidth=0.025,
fill="steelblue", color="white")
plot(p1)
Run the code above in your browser using DataLab