mutation.network: Make mutation network for the given repertoire.

Description Usage Arguments Value See Also Examples

Description

Mutation network (or a mutation graph) is a graph with vertices representing nucleotide or in-frame amino acid sequences (out-of-frame amino acid sequences will automatically filtered out) and edges are connecting pairs of sequences with hamming distance or edit distance between them no more than specified in the .max.errors function parameter.

Usage

1
2
3
4
5
6
7
8
mutation.network(
  .data,
  .method = c("hamm", "lev"),
  .max.errors = 1,
  .label.col = "CDR3.amino.acid.sequence",
  .seg.col = "V.gene",
  .prob.col = "Probability"
)

Arguments

.data

Either character vector of sequences, data frame with .label.col or shared repertoire (result from the shared.repertoire function) constructed based on .label.col.

.method

Either "hamm" (for hamming distance) or "lev" (for edit distance). Passed to the find.similar.sequences function.

.max.errors

Passed to the find.similar.sequences function.

.label.col

Name of the column with CDR3 sequences (vertex labels).

.seg.col

Name of the column with V gene segments.

.prob.col

Name of the column with clonotype probability.

Value

Mutation network, i.e. igraph object with input sequences as vertices labels, ???

See Also

shared.repertoire, find.similar.sequences, set.people.vector, get.people.names

Examples

1
2
3
4
5
6
7
8
## Not run: 
data(twb)
twb.shared <- shared.repertoire(twb)
G <- mutation.network(twb.shared)
get.people.names(G, 300, T)  # "Subj.A|Subj.B"
get.people.names(G, 300, F)  # list(c("Subj.A", "Subj.B"))

## End(Not run)

Example output

Loading required package: ggplot2
Loading required package: dplyr

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

Loading required package: gridExtra

Attaching package:gridExtraThe following object is masked frompackage:dplyr:

    combine

Loading required package: reshape2
Loading required package: igraph

Attaching package:igraphThe following objects are masked frompackage:dplyr:

    as_data_frame, groups, union

The following objects are masked frompackage:stats:

    decompose, spectrum

The following object is masked frompackage:base:

    union

sh: 1: wc: Permission denied
Could not detect number of cores, defaulting to 1.

========================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! The tcR package WILL SOON BE ORPHANED 
!! AND REMOVED FROM CRAN.
!!
!! A new package is available that is 
!! designed to replace tcR: 
!! immunarch  --  https://immunarch.com/
!!
!! We will be happy to help you to move
!! to the new package. Feel free to contact us:
!! http://github.com/immunomind/immunarch
!!
!! Sincerely, 
!!  immunarch dev team and 
!!  Vadim I. Nazarov, lead developer of tcR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=======================================

Attaching package:tcRThe following object is masked frompackage:igraph:

    diversity

Aggregating sequences...

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
Merging data tables...

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================================| 100%
[1] "Subj.A|Subj.B"
[[1]]
[1] "Subj.A" "Subj.B"

tcR documentation built on July 2, 2020, 3:18 a.m.