Biostrings包测试2_MultipleAlignment Objects_2020-01-30

Biostrings包测试2_MultipleAlignment Objects _20200130Thursday

1.设置当前工作目录

getwd()
setwd("./Biostrings/")

2.导入R包

library(Biostrings)

3.测试:MultipleAlignment Objects

3.1 Introduction

#@ The DNAMultipleAlignment RNAMultipleAlignment and AAMultipleAlignment classes allow users to represent groups of aligned DNA, RNA or amino acid sequences as a single object. The frame of reference for aligned sequences is static, so manipulation of these objects is confined to be non-destructive. In practice, this means that these objects contain slots to mask ranges of rows and columns on the original sequence.
#@ These masks are then respected by methods that manipulate and display the objects, allowing the user to remove or expose columns and rows without invalidating the original alignment.

3.2 Creation and masking

To create a MultipleAlignment, call the appropriate read function to read in and parse the original alignment.

There are functions to read clustaW, Phylip and Stolkholm data formats.

origMAlign <- readDNAMultipleAlignment(filepath = system.file(“extdata”, “msx2_mRNA.aln”, package=“Biostrings”), format=“clustal”)

phylipMAlign <- readAAMultipleAlignment(filepath = system.file(“extdata”, “Phylip.txt”, package = “Biostrings”), format= “phylip”)

#@ Rows can be renamed with rownames.
rownames(origMAlign)

[1] “gi|84452153|ref|NM_002449.4|”

[2] “gi|208431713|ref|NM_001135625.”

[3] “gi|118601823|ref|NM_001079614.”

[4] “gi|114326503|ref|NM_013601.2|”

[5] “gi|119220589|ref|NM_012982.3|”

[6] “gi|148540149|ref|NM_001003098.”

[7] “gi|45383056|ref|NM_204559.1|”

[8] “gi|213515133|ref|NM_001141603.”

rownames(origMAlign) <- c(“Human”,“Chimp”,“Cow”,“Mouse”,“Rat”, “Dog”,“Chicken”,“Salmon”)
origMAlign

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] -----TCCCGTCTCCGCAGCAAAAAAGTTTGAGTCGCCGCTGCCGGGTTGC…TTATTGCAGTAAAGTTTGTCCAAACTCACAATTAAAAAAAAAAAAAAAAA Human

[2] ---------------------------------------------------…-------------------------------------------------- Chimp

[3] ---------------------------------------------------…-------------------------------------------------- Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

#@ To see a more detailed version of your MultipleAlignment object, you can use the detail method, which will show the details of the alignment interleaved and without the rows and columns that you have masked out.

detail(origMAlign)

#@ Applying masks is a simple matter of specifying which ranges to hide.
maskTest <- origMAlign
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

rowmask(maskTest) <- IRanges(start=1,end=3)
rowmask(maskTest)

NormalIRanges object with 1 range and 0 metadata columns:

start end width

[1] 1 3 3

maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

colmask(maskTest) <- IRanges(start=c(1,1000),end=c(500,2343))
colmask(maskTest)

NormalIRanges object with 2 ranges and 0 metadata columns:

start end width

[1] 1 500 500

[2] 1000 2343 1344

maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ###################################################…################################################## Mouse

[5] ###################################################…################################################## Rat

[6] ###################################################…################################################## Dog

[7] ###################################################…################################################## Chicken

[8] ###################################################…################################################## Salmon

#@ Remove row and column masks by assigning NULL:
rowmask(maskTest) <- NULL
rowmask(maskTest)

NormalIRanges object with 0 ranges and 0 metadata columns:

start end width

colmask(maskTest) <- NULL
colmask(maskTest)

NormalIRanges object with 0 ranges and 0 metadata columns:

start end width

maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] -----TCCCGTCTCCGCAGCAAAAAAGTTTGAGTCGCCGCTGCCGGGTTGC…TTATTGCAGTAAAGTTTGTCCAAACTCACAATTAAAAAAAAAAAAAAAAA Human

[2] ---------------------------------------------------…-------------------------------------------------- Chimp

[3] ---------------------------------------------------…-------------------------------------------------- Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

#@ When setting a mask, you might want to specify the rows or columns to keep, rather than to hide. To do that, use the invert argument. Taking the above example, we can set the exact same masks as before by specifying their inverse and using invert=TRUE.

rowmask(maskTest, invert=TRUE) <- IRanges(start=4,end=8)
rowmask(maskTest)

NormalIRanges object with 1 range and 0 metadata columns:

start end width

[1] 1 3 3

maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

colmask(maskTest, invert=TRUE) <- IRanges(start=501,end=999)
colmask(maskTest)

NormalIRanges object with 2 ranges and 0 metadata columns:

start end width

[1] 1 500 500

[2] 1000 2343 1344

maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ###################################################…################################################## Mouse

[5] ###################################################…################################################## Rat

[6] ###################################################…################################################## Dog

[7] ###################################################…################################################## Chicken

[8] ###################################################…################################################## Salmon

In addition to being able to invert these masks, you can also choose the way in which the ranges you

provide will be merged with any existing masks. The append argument allows you to specify the way in

which new mask ranges will interact with any existing masks. By default, these masks will be the “union”

of the new mask and any existing masks, but you can also specify that these masks be the mask that results

from when you “intersect” the current mask and the new mask, or that the new mask simply “replace” the

current mask. The append argument can be used in combination with the invert argument to make things

even more interesting. In this case, the inversion of the mask will happen before it is combined with the

existing mask. For simplicity, I will only demonstrate this on rowmask, but it also works for colmask. Before

we begin, lets set the masks back to being NULL again.

#@ 1st lets null out the masks so we can have a fresh start.
colmask(maskTest) <- NULL
rowmask(maskTest) <- NULL

#@ Then we can do a series of examples, starting with the default which uses the “union” value for the append argument.
##@ Then we can demonstrate how the append argument works
rowmask(maskTest) <- IRanges(start=1,end=3)
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

rowmask(maskTest,append=“intersect”) <- IRanges(start=2,end=5)
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] -----TCCCGTCTCCGCAGCAAAAAAGTTTGAGTCGCCGCTGCCGGGTTGC…TTATTGCAGTAAAGTTTGTCCAAACTCACAATTAAAAAAAAAAAAAAAAA Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

rowmask(maskTest,append=“replace”) <- IRanges(start=5,end=8)
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] -----TCCCGTCTCCGCAGCAAAAAAGTTTGAGTCGCCGCTGCCGGGTTGC…TTATTGCAGTAAAGTTTGTCCAAACTCACAATTAAAAAAAAAAAAAAAAA Human

[2] ---------------------------------------------------…-------------------------------------------------- Chimp

[3] ---------------------------------------------------…-------------------------------------------------- Cow

[4] ----------------------AAAAGTTGGAGTCTTCGCTTGAGAGTTGC…TTATTGCAGT---------------------------------------- Mouse

[5] ###################################################…################################################## Rat

[6] ###################################################…################################################## Dog

[7] ###################################################…################################################## Chicken

[8] ###################################################…################################################## Salmon

rowmask(maskTest,append=“replace”,invert=TRUE) <- IRanges(start=5,end=8)
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ###################################################…################################################## Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] --------------CGGCTCCGCAGCGCCTCACTCGCGCAGTCCCCGCGCA…-------------------------------------------------- Chicken

[8] GGGGGAGACTTCAGAAGTTGTTGTCCTCTCCGCTGATAACAGTTGAGATGC…-------------------------------------------------- Salmon

rowmask(maskTest,append=“union”) <- IRanges(start=7,end=8)
maskTest

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ###################################################…################################################## Mouse

[5] ---------------------------------------------------…TTATTGCAGTAAA------------------------------------- Rat

[6] ---------------------------------------------------…-------------------------------------------------- Dog

[7] ###################################################…################################################## Chicken

[8] ###################################################…################################################## Salmon

#@ The function maskMotif works on MultipleAlignment objects too, and takes the same arguments that it does elsewhere. maskMotif is useful for masking occurances of a string from columns where it is present in the consensus sequence.

tataMasked <- maskMotif(origMAlign, “TATA”)
colmask(tataMasked)

NormalIRanges object with 5 ranges and 0 metadata columns:

start end width

[1] 811 814 4

[2] 1180 1183 4

[3] 1186 1191 6

[4] 1204 1207 4

[5] 1218 1221 4

#@ maskGaps also operates on columns and will mask collumns based on the fraction of each column that contains gaps min.fraction along with the width of columns that contain this fraction of gaps min.block.width.
autoMasked <- maskGaps(origMAlign, min.fraction=0.5, min.block.width=4)
autoMasked

DNAMultipleAlignment with 8 rows and 2343 columns

aln names

[1] ###################################################…################################################## Human

[2] ###################################################…################################################## Chimp

[3] ###################################################…################################################## Cow

[4] ###################################################…################################################## Mouse

[5] ###################################################…################################################## Rat

[6] ###################################################…################################################## Dog

[7] ###################################################…################################################## Chicken

[8] ###################################################…################################################## Salmon

#@ Sometimes you may want to cast your MultipleAlignment to be a matrix for usage eslewhere. as.matrix is supported for these circumstances. The ability to convert one object into another is not very unusual so why mention it? Because when you cast your object, the masks WILL be considered so that the masked rows and columns will be left out of the matrix object.

full <- as.matrix(origMAlign)
dim(full)

[1] 8 2343

partial <- as.matrix(autoMasked)
dim(partial)

#@ One example of where you might want to use as.matrix is when using the ape package. For example if you needed to use the dist.dna function you would want to use as.matrix followed by as.alignment and then the as.DNAbin to create a DNAbin object for the dist.dna.

3.3 Analytic utilities

Once you have masked the sequence, you can then ask questions about the properties of that sequence. For

example, you can look at the alphabet frequency of that sequence. The alphabet frequency will only be for

the masked sequence.

alphabetFrequency(autoMasked)

A C G T M R W S Y K V H D B N - + .

[1,] 260 351 296 218 0 0 0 0 0 0 0 0 0 0 0 18 0 0

[2,] 171 271 231 128 0 0 0 0 0 0 0 0 0 0 3 339 0 0

[3,] 277 360 275 209 0 0 0 0 0 0 0 0 0 0 0 22 0 0

[4,] 265 343 277 226 0 0 0 0 0 0 0 0 0 0 0 32 0 0

[5,] 251 345 287 229 0 0 0 0 0 0 0 0 0 0 0 31 0 0

[6,] 160 285 241 118 0 0 0 0 0 0 0 0 0 0 0 339 0 0

[7,] 224 342 273 190 0 0 0 0 0 0 0 0 0 0 0 114 0 0

[8,] 268 289 273 262 0 0 0 0 0 0 0 0 0 0 0 51 0 0

#@ You can also calculate a consensus matrix, extract the consensus string or look at the consensus views. These methods too will all consider the masking when you run them.
consensusMatrix(autoMasked, baseOnly=TRUE)[, 84:90]

[,1] [,2] [,3] [,4] [,5] [,6] [,7]

A 0 3 0 3 0 3 3

C 3 0 0 1 1 1 2

G 1 2 4 1 2 0 0

T 1 0 1 0 1 1 0

other 3 3 3 3 4 3 3

substr(consensusString(autoMasked),80,130)

[1] “####CRGABAMGTCA-YRGCTTCTCYGTSCAWAGGCRRTGRCYTGTTYTCG”

consensusViews(autoMasked)

Views on a 2343-letter BString subject

subject: ----------------------VWVMKYYBSRSTSDYVVMDKBHSVGHKSMSVRYVKDR…-----------------------------------------------------------

views:

start end width

[1] 84 325 242 [CRGABAMGTCA-YRGCTTCTCYGTSCAWAGGCRRTGRCYTGTTYTCGYCCRR…GGARKCGYCSSCGSKGCCRSCCGAMWGCGSCTCSGCYGGSGCYRYCCTGSGG]

[2] 330 332 3 [CCR]

[3] 338 1191 854 [CTGCTGCTGYCGGGVCACGGCGYYCGG-GAMGCKCMCAGYCCC—GGGCCK…CTTTTCCYYTCASARW-KATTGGCTCTGMTAGTTTTTATGTATAAATATATA]

[4] 1198 1241 44 [ATAAAATATAAKAC–TTTTTATAYRSCARATGTAAAAATTCAA]

You can also cluster the alignments based on their distance to each other. Because you must pass in

a DNAStringSet, the clustering will also take into account the masking. So for example, you can see how

clustering the unmasked DNAMultipleAlignment will draw a funky looking tree.

sdist <- stringDist(as(origMAlign,“DNAStringSet”), method=“hamming”)
clust <- hclust(sdist, method = “single”)
pdf(file=“badTree.pdf”)
plot(clust)
dev.off()

#@ But, if we use the gap-masked DNAMultipleAlignment, to remove the long uninformative regions, and then make our plot, we can see the real relationships.
sdist <- stringDist(as(autoMasked,“DNAStringSet”), method=“hamming”)
clust <- hclust(sdist, method = “single”)
pdf(file=“goodTree.pdf”)
plot(clust)
dev.off()

fourgroups <- cutree(clust, 4)
fourgroups

Human Chimp Cow Mouse Rat Dog Chicken Salmon

1 2 1 1 1 2 3 4

In the “good” plot, the Salmon sequence is once again the most distant which is what we expect to

see. A closer examination of the sequence reveals that the similarity between the mouse, rat and human

sequences was being inflated by virtue of the fact that those sequences were simply much longer (had more

information than) the other species represented. This is what caused the “funky” result. The relationship

between the sequences in the funky tree was being driven by extra “length” in the rodent/mouse/human

sequences, instead of by the similarity of the conserved regions.

3.4 Exporting to file

One possible export option is to write to fasta files If you need to write your MultipleAlignment object out

as a fasta file, you can cast it to a DNAStringSet and then write it out as a fasta file like so:

DNAStr = as(origMAlign, “DNAStringSet”)
writeXStringSet(DNAStr, file=“myFile.fa”)

#@ One other format that is of interest is the Phylip format. The Phylip format sOne other format that is of interest is the Phylip format. The Phylip format stores the column masking of your object as well as the sequence that you are exporting. So if you have masked the sequence and you write out a Phylip file, this mask will be recorded into the file you export. As with the fasta example above, any rows that you have masked out will be removed from the exported file.

write.phylip(phylipMAlign, filepath=“myFile.txt”)

4.结束

sessionInfo()

R version 3.6.2 (2019-12-12)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:

[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936

[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C

[5] LC_TIME=Chinese (Simplified)_China.936

attached base packages:

[1] stats4 parallel stats graphics grDevices utils datasets methods base

other attached packages:

[1] Biostrings_2.54.0 XVector_0.26.0 IRanges_2.20.2 S4Vectors_0.24.2 BiocGenerics_0.32.0

loaded via a namespace (and not attached):

[1] Seurat_3.1.2 TH.data_1.0-10 Rtsne_0.15 colorspace_1.4-1 seqinr_3.6-1 pryr_0.1.4

[7] ggridges_0.5.2 rstudioapi_0.10 leiden_0.3.2 listenv_0.8.0 npsurv_0.4-0 ggrepel_0.8.1

[13] alakazam_0.3.0 mvtnorm_1.0-12 codetools_0.2-16 splines_3.6.2 R.methodsS3_1.7.1 mnormt_1.5-5

[19] lsei_1.2-0 TFisher_0.2.0 zeallot_0.1.0 ade4_1.7-13 jsonlite_1.6 packrat_0.5.0

[25] ica_1.0-2 cluster_2.1.0 png_0.1-7 R.oo_1.23.0 uwot_0.1.5 sctransform_0.2.1

[31] readr_1.3.1 compiler_3.6.2 httr_1.4.1 backports_1.1.5 assertthat_0.2.1 Matrix_1.2-18

[37] lazyeval_0.2.2 htmltools_0.4.0 prettyunits_1.1.0 tools_3.6.2 rsvd_1.0.2 igraph_1.2.4.2

[43] gtable_0.3.0 glue_1.3.1 RANN_2.6.1 reshape2_1.4.3 dplyr_0.8.3 Rcpp_1.0.3

[49] Biobase_2.46.0 vctrs_0.2.1 multtest_2.42.0 gdata_2.18.0 ape_5.3 nlme_3.1-142

[55] gbRd_0.4-11 lmtest_0.9-37 stringr_1.4.0 globals_0.12.5 lifecycle_0.1.0 irlba_2.3.3

[61] gtools_3.8.1 future_1.16.0 zlibbioc_1.32.0 MASS_7.3-51.4 zoo_1.8-7 scales_1.1.0

[67] hms_0.5.3 sandwich_2.5-1 RColorBrewer_1.1-2 reticulate_1.14 pbapply_1.4-2 gridExtra_2.3

[73] ggplot2_3.2.1 stringi_1.4.3 mutoss_0.1-12 plotrix_3.7-7 caTools_1.17.1.4 bibtex_0.4.2.2

[79] Rdpack_0.11-1 SDMTools_1.1-221.2 rlang_0.4.2 pkgconfig_2.0.3 bitops_1.0-6 lattice_0.20-38

[85] ROCR_1.0-7 purrr_0.3.3 htmlwidgets_1.5.1 cowplot_1.0.0 tidyselect_0.2.5 RcppAnnoy_0.0.14

[91] plyr_1.8.5 magrittr_1.5 R6_2.4.1 gplots_3.0.1.2 multcomp_1.4-12 pillar_1.4.3

[97] sn_1.5-4 fitdistrplus_1.0-14 survival_3.1-8 tibble_2.1.3 future.apply_1.4.0 tsne_0.1-3

[103] crayon_1.3.4 KernSmooth_2.23-16 plotly_4.9.1 progress_1.2.2 grid_3.6.2 data.table_1.12.8

[109] metap_1.2 digest_0.6.23 tidyr_1.0.0 numDeriv_2016.8-1.1 R.utils_2.9.2 RcppParallel_4.4.4

[115] munsell_0.5.0 viridisLite_0.3.0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
set_level_shifter strategy_name -domain domain_name [-elements port_pin_list] [-exclude_elements exclude_list] [-applies_to inputs | outputs | both] [-applies_to_boundary upper | lower | both] [-threshold float] [-rule low_to_high | high_to_low | both] [-location self | parent | fanout | automatic] [-no_shift] [-force_shift] [-name_prefix prefix_string] [-name_suffix suffix_string] [-update] set_level_shifter –domain domain_name –elements ... [–applies_to ...] set_level_shifter –domain domain_name –applies_to [inputs | outputs] set_level_shifter –domain domain_name map_level_shifter_cell strategy_name -domain power_domain_name -lib_cells list use_interface_cell interface_implementation_name -domain domain_name -lib_cells lib_cell_list -strategy list_of_one_level_shifter_and_or_one_isolation set_isolation isolation_strategy_name -domain power_domain [-elements objects] [-exclude_elements exclude_list] [-applies_to inputs | outputs | both] [-applies_to_boundary upper | lower | both] [-clamp_value 0 | 1 | latch] [-isolation_power_net isolation_power_net] [-isolation_ground_net isolation_ground_net] [-isolation_supply isolation_supply_set] [-source source_supply_set_name] [-sink sink_supply_set_name] [-diff_supply_only true | false] [-no_isolation] [-force_isolation] [-name_prefix prefix_string] set_isolation_control isolation_strategy_name -domain power_domain -isolation_signal isolation_signal load_upf upf_file_name [-supplemental supf_file_name] [-scope string] [-noecho] save_upf upf_file_name [-supplemental supf_file_name] [-include_supply_exceptions] [-full_upf] 解释每一句命令什么意思
07-22
以下是对每个Tcl命令的解释: 1. set_level_shifter: - 设置电平转换器的策略名称(strategy_name)和电源域(domain_name)。 - 可选参数: - elements: 指定端口或引脚的列表。 - exclude_elements: 排除在电平转换器操作之外的元素列表。 - applies_to: 指定应用于输入、输出或两者的电平转换操作。 - applies_to_boundary: 指定应用于边界元素的电平转换操作。 - threshold: 指定电平转换的阈值。 - rule: 指定转换规则,例如从低到高、从高到低或两者都适用。 - location: 指定电平转换器的位置。 - no_shift: 禁用电平转换操作。 - force_shift: 强制进行电平转换操作。 - name_prefix: 为生成的电平转换器命名添加前缀。 - name_suffix: 为生成的电平转换器命名添加后缀。 - update: 更新已经存在的电平转换器。 2. map_level_shifter_cell: - 将电平转换器策略(strategy_name)映射到指定的电源域(power_domain_name)。 - lib_cells: 指定要在映射中使用的库单元列表。 3. use_interface_cell: - 使用接口实现单元(interface_implementation_name)。 - domain_name: 指定要使用接口实现的电源域。 - lib_cells: 指定要在接口实现中使用的库单元列表。 - strategy: 指定用于接口实现的电平转换器和/或隔离器的列表。 4. set_isolation: - 设置隔离器的策略名称(isolation_strategy_name)和电源域(power_domain)。 - 可选参数: - elements: 指定要隔离的对象列表。 - exclude_elements: 排除在隔离操作之外的元素列表。 - applies_to: 指定应用于输入、输出或两者的隔离操作。 - applies_to_boundary: 指定应用于边界元素的隔离操作。 - clamp_value: 指定在隔离期间,隔离电路产生的电平(0、1或锁存)。 - isolation_power_net: 指定隔离电源网络。 - isolation_ground_net: 指定隔离地网络。 - isolation_supply: 指定隔离供电集合。 - source: 指定源供电集合。 - sink: 指定汇供电集合。 - diff_supply_only: 仅对差分供电进行隔离。 - no_isolation: 禁用隔离操作。 - force_isolation: 强制进行隔离操作。 - name_prefix: 为生成的隔离器命名添加前缀。 5. set_isolation_control: - 设置隔离器的控制信号(isolation_signal)。 - domain: 指定要设置控制信号的电源域。 - isolation_signal: 指定隔离器的控制信号。 6. load_upf: - 加载UPF文件(upf_file_name)。 - 可选参数: - supplemental: 指定附加的UPF文件。 - scope: 指定加载UPF文件的作用域。 - noecho: 禁止在加载UPF文件时显示相关信息。 7. save_upf: - 保存UPF文件(upf_file_name)。 - 可选参数: - supplemental: 指定附加的UPF文件。 - include_supply_exceptions: 含供电异常信息。 - full_upf: 保存完整的UPF文件。 希望以上解释能够帮助您理解这些Tcl命令的含义。如果还有其他问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值