Related
So, this is my problem.
This script works with one image id, but not any others.
I literally have no idea why this is happening.
This is the script >>
function newEntity(imgId, eName)
EntityBase = Instance.new("Part", workspace)
EntityBase.Transparency = 1
EntityBase.Size = Vector3.new(0.9, 0.1, 0.7)
EntityBase.Name = eName
EntityBillboardGui = Instance.new("BillboardGui", EntityBase)
EntityBillboardGui.StudsOffset = Vector3.new(0, 5, 0)
EntityBillboardGui.Size = UDim2.new(0,250,0,250)
EntityBillboardGui.MaxDistance = math.huge
EntityBillboardGui.Adornee = EntityBase
EntityImage = Instance.new("ImageLabel",EntityBillboardGui)
EntityImage.Size = EntityBillboardGui.Size
EntityImage.BackgroundTransparency = 1
EntityImage.Image = imgId
return EntityBase
end
troller = newEntity("rbxthumb://11954446780","imposter")
troller.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
trololol = Instance.new("Sound", troller)
trololol.SoundId = "http://www.roblox.com/asset/?id=5677788502"
trololol:Play()
wait(2)
troller:Destroy()
game.Players.LocalPlayer.Character.Humanoid.Health = 0
Can anybody help fix it?
For starters I would recommend seperating the parent, like this:
EntityBase = Instance.new("Part") EntityBase.Parent = workspace
SECOND: I would recommend not using a seperate part, just put the billboardGui into the player's head
third you used rbxthumb wrong
rbxthumb://type=[ThumbnailType]&id=[TargetId]&w=[Width]&h=[Height]”
These are the supported sizes and types
example: rbxthumb://type=Avatar&id=123456789&w=720&h=720
I'm trying to create a Gaussian HMM model in pyro to infer the parameters of a very simple Markov sequence. However, my model fails to infer the parameters and something wired happened during the training process. Using the same sequence, hmmlearn has successfully infer the true parameters.
Full code can be accessed in here:
https://colab.research.google.com/drive/1u_4J-dg9Y1CDLwByJ6FL4oMWMFUVnVNd#scrollTo=ZJ4PzdTUBgJi
My model is modified from the example in here:
https://github.com/pyro-ppl/pyro/blob/dev/examples/hmm.py
I manually created a first order Markov sequence where there are 3 states, the true means are [-10, 0, 10], sigmas are [1,2,1].
Here is my model
def model(observations, num_state):
assert not torch._C._get_tracing_state()
with poutine.mask(mask = True):
p_transition = pyro.sample("p_transition",
dist.Dirichlet((1 / num_state) * torch.ones(num_state, num_state)).to_event(1))
p_init = pyro.sample("p_init",
dist.Dirichlet((1 / num_state) * torch.ones(num_state)))
p_mu = pyro.param(name = "p_mu",
init_tensor = torch.randn(num_state),
constraint = constraints.real)
p_tau = pyro.param(name = "p_tau",
init_tensor = torch.ones(num_state),
constraint = constraints.positive)
current_state = pyro.sample("x_0",
dist.Categorical(p_init),
infer = {"enumerate" : "parallel"})
for t in pyro.markov(range(1, len(observations))):
current_state = pyro.sample("x_{}".format(t),
dist.Categorical(Vindex(p_transition)[current_state, :]),
infer = {"enumerate" : "parallel"})
pyro.sample("y_{}".format(t),
dist.Normal(Vindex(p_mu)[current_state], Vindex(p_tau)[current_state]),
obs = observations[t])
My model is compiled as
device = torch.device("cuda:0")
obs = torch.tensor(obs)
obs = obs.to(device)
torch.set_default_tensor_type("torch.cuda.FloatTensor")
guide = AutoDelta(poutine.block(model, expose_fn = lambda msg : msg["name"].startswith("p_")))
Elbo = Trace_ELBO
elbo = Elbo(max_plate_nesting = 1)
optim = Adam({"lr": 0.001})
svi = SVI(model, guide, optim, elbo)
As the training goes, the ELBO has decreased steadily as shown. However, the three means of the states converges.
I have tried to put the for loop of my model into a pyro.plate and switch pyro.param to pyro.sample and vice versa, but nothing worked for my model.
I have not tried this model, but I think it should be possible to solve the problem by modifying the model in the following way:
def model(observations, num_state):
assert not torch._C._get_tracing_state()
with poutine.mask(mask = True):
p_transition = pyro.sample("p_transition",
dist.Dirichlet((1 / num_state) * torch.ones(num_state, num_state)).to_event(1))
p_init = pyro.sample("p_init",
dist.Dirichlet((1 / num_state) * torch.ones(num_state)))
p_mu = pyro.sample("p_mu",
dist.Normal(torch.zeros(num_state), torch.ones(num_state)).to_event(1))
p_tau = pyro.sample("p_tau",
dist.HalfCauchy(torch.zeros(num_state)).to_event(1))
current_state = pyro.sample("x_0",
dist.Categorical(p_init),
infer = {"enumerate" : "parallel"})
for t in pyro.markov(range(1, len(observations))):
current_state = pyro.sample("x_{}".format(t),
dist.Categorical(Vindex(p_transition)[current_state, :]),
infer = {"enumerate" : "parallel"})
pyro.sample("y_{}".format(t),
dist.Normal(Vindex(p_mu)[current_state], Vindex(p_tau)[current_state]),
obs = observations[t])
The model would then be trained using MCMC:
# MCMC
hmc_kernel = NUTS(model, target_accept_prob = 0.9, max_tree_depth = 7)
mcmc = MCMC(hmc_kernel, num_samples = 1000, warmup_steps = 100, num_chains = 1)
mcmc.run(obs)
The results could then be analysed using:
mcmc.get_samples()
As far as I can find, there is only one tutorial about loading Seurat objects into WGCNA (https://ucdavis-bioinformatics-training.github.io/2019-single-cell-RNA-sequencing-Workshop-UCD_UCSF/scrnaseq_analysis/scRNA_Workshop-PART6.html). I am really new to programming so it's probably just my inexperience, but I am not sure how to load my Seurat object into a format that works with WGCNA's tutorials (https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/).
Here is what I have tried thus far:
This tries to replicate datExpr and datTraits from part I.1:
library(WGCNA)
library(Seurat)
#example Seurat object -----------------------------------------------
ERlist <- list(c("CPB1", "RP11-53O19.1", "TFF1", "MB", "ANKRD30B",
"LINC00173", "DSCAM-AS1", "IGHG1", "SERPINA5", "ESR1",
"ILRP2", "IGLC3", "CA12", "RP11-64B16.2", "SLC7A2",
"AFF3", "IGFBP4", "GSTM3", "ANKRD30A", "GSTT1", "GSTM1",
"AC026806.2", "C19ORF33", "STC2", "HSPB8", "RPL29P11",
"FBP1", "AGR3", "TCEAL1", "CYP4B1", "SYT1", "COX6C",
"MT1E", "SYTL2", "THSD4", "IFI6", "K1AA1467", "SLC39A6",
"ABCD3", "SERPINA3", "DEGS2", "ERLIN2", "HEBP1", "BCL2",
"TCEAL3", "PPT1", "SLC7A8", "RP11-96D1.10", "H4C8",
"PI15", "PLPP5", "PLAAT4", "GALNT6", "IL6ST", "MYC",
"BST2", "RP11-658F2.8", "MRPS30", "MAPT", "AMFR", "TCEAL4",
"MED13L", "ISG15", "NDUFC2", "TIMP3", "RP13-39P12.3", "PARD68"))
tnbclist <- list(c("FABP7", "TSPAN8", "CYP4Z1", "HOXA10", "CLDN1",
"TMSB15A", "C10ORF10", "TRPV6", "HOXA9", "ATP13A4",
"GLYATL2", "RP11-48O20.4", "DYRK3", "MUCL1", "ID4", "FGFR2",
"SHOX2", "Z83851.1", "CD82", "COL6A1", "KRT23", "GCHFR",
"PRICKLE1", "GCNT2", "KHDRBS3", "SIPA1L2", "LMO4", "TFAP2B",
"SLC43A3", "FURIN", "ELF5", "C1ORF116", "ADD3", "EFNA3",
"EFCAB4A", "LTF", "LRRC31", "ARL4C", "GPNMB", "VIM",
"SDR16C5", "RHOV", "PXDC1", "MALL", "YAP1", "A2ML1",
"RP1-257A7.5", "RP11-353N4.6", "ZBTB18", "CTD-2314B22.3", "GALNT3",
"BCL11A", "CXADR", "SSFA2", "ADM", "GUCY1A3", "GSTP1",
"ADCK3", "SLC25A37", "SFRP1", "PRNP", "DEGS1", "RP11-110G21.2",
"AL589743.1", "ATF3", "SIVA1", "TACSTD2", "HEBP2"))
genes = c(unlist(c(ERlist,tnbclist)))
mat = matrix(rnbinom(500*length(genes),mu=500,size=1),ncol=500)
rownames(mat) = genes
colnames(mat) = paste0("cell",1:500)
sobj = CreateSeuratObject(mat)
sobj = NormalizeData(sobj)
sobj$ClusterName = factor(sample(0:1,ncol(sobj),replace=TRUE))
sobj$Patient = paste0("Patient", 1:500)
sobj = AddModuleScore(object = sobj, features = tnbclist,
name = "TNBC_List",ctrl=5)
sobj = AddModuleScore(object = sobj, features = ERlist,
name = "ER_List",ctrl=5)
#WGCNA -----------------------------------------------------------------
sobjwgcna <- sobj
sobjwgcna <- FindVariableFeatures(sobjwgcna, selection.method = "vst", nfeatures = 2000,
verbose = FALSE, assay = "RNA")
options(stringsAsFactors = F)
sobjwgcnamat <- GetAssayData(sobjwgcna)
datExpr <- t(sobjwgcnamat)[,VariableFeatures(sobjwgcna)]
datTraits <- sobjwgcna#meta.data
datTraits = subset(datTraits, select = -c(nCount_RNA, nFeature_RNA))
I then copy-paste the code as written in the WGCNA I.2a tutorial (https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-02-networkConstr-auto.pdf), and that all works until I get to this line in the I.3 tutorial (https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-03-relateModsToExt.pdf):
MEList = moduleEigengenes(datExpr, colors = moduleColors)
Error in t.default(expr[, restrict1]) : argument is not a matrix
I tried converting both moduleColors and datExpr into a matrix with as.matrix(), but the error still persists.
Hopefully this makes sense, and thanks for reading!
So doing as.matrix(datExpr) right after datExpr <- t(sobjwgcnamat)[,VariableFeatures(sobjwgcna)] worked. I had been trying it right before MEList = moduleEigengenes(datExpr, colors = moduleColors)
and that didn't work. Seems simple but order matters I guess.
I have changed an .arff file to a .csv file in a tool in Weka.
But now I can't use the arffparser as parser in ELKI.
What parser should I then use? The default is NumberVectorLabelParser. But it gives me a ArrayIndexOutOfBoundsException:
Running: -verbose -verbose -dbc.in /home/db/lisbet/Datasets/without ids/try 2/calling them .txt using another parser/Lymphography_withoutdupl_norm_1ofn.csv -dbc.parser NumberVectorLabelParser -algorithm outlier.lof.LOF -lof.k 2 -evaluator outlier.OutlierROCCurve -rocauc.positive yes
Task failed
java.lang.ArrayIndexOutOfBoundsException: 47
at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.getTypeInformation(NumberVectorLabelParser.java:337)
at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.buildMeta(NumberVectorLabelParser.java:242)
at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.nextEvent(NumberVectorLabelParser.java:211)
at de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle.fromStream(MultipleObjectsBundle.java:242)
at de.lmu.ifi.dbs.elki.datasource.parser.AbstractStreamingParser.asMultipleObjectsBundle(AbstractStreamingParser.java:89)
at de.lmu.ifi.dbs.elki.datasource.InputStreamDatabaseConnection.loadData(InputStreamDatabaseConnection.java:91)
at de.lmu.ifi.dbs.elki.database.StaticArrayDatabase.initialize(StaticArrayDatabase.java:119)
at de.lmu.ifi.dbs.elki.workflow.InputStep.getDatabase(InputStep.java:62)
at de.lmu.ifi.dbs.elki.KDDTask.run(KDDTask.java:108)
at de.lmu.ifi.dbs.elki.application.KDDCLIApplication.run(KDDCLIApplication.java:60)
at [...]
My .csv file looks like this:
'Lymphatics = deformed','Lymphatics = displaced','Lymphatics = arched','Lymphatics = normal','Block_of_affere = yes','Block_of_affere = no','Bl_of_lymph_c = no','Bl_of_lymph_c = yes','Bl_of_lymph_s = no','Bl_of_lymph_s = yes','By_pass = no','By_pass = yes','Extravasates = yes','Extravasates = no','Regeneration_of = no','Regeneration_of = yes','Early_uptake_in = yes','Early_uptake_in = no','Changes_in_lym = oval','Changes_in_lym = round','Changes_in_lym = bean','Defect_in_node = lacunar','Defect_in_node = lac_central','Defect_in_node = lac_margin','Defect_in_node = no','Changes_in_node = lac_central','Changes_in_node = lacunar','Changes_in_node = no','Changes_in_node = lac_margin','Changes_in_stru = faint','Changes_in_stru = drop_like','Changes_in_stru = stripped','Changes_in_stru = coarse','Changes_in_stru = diluted','Changes_in_stru = grainy','Changes_in_stru = no','Changes_in_stru = reticular','Special_forms = vesicles','Special_forms = no','Special_forms = chalices','Dislocation_of = no','Dislocation_of = yes','Exclusion_of_no = yes','Exclusion_of_no = no',Lym_nodes_dimin,Lym_nodes_enlar,No_of_nodes_in,Outlier
1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0.333333,0.285714,no
0,1,0,0,1,0,1,0,1,0,1,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0.333333,0.142857,no
There are 11 parsers available. But maybe it is my data, that is to large for the parser.
Thank you, this is a bug in the ELKI CSV parser.
It did not expect the class column to have a label.
So if your remove the ,Outlier part of your first line (or the first line completely), it should read this file just fine.
I will push a change that makes it more robust here (it will still lose the label though, because ELKI currently has support column labels for numerical columns but not for string label columns).
I am working on creating HL7 VXU V04 type message using NHapi V2.5.
Below is the required message outcome( from NIST site:http://hl7v2-iz-testing.nist.gov/mu-immunization/)
The issue I am running into is how to create four OBX segments("NHapi.Model.V25.Segment.OBX ") and add it to the "NHapi.Model.V25.Group.VXU_V04_ORDER" ?
Below is my code, Line#5 works, it create multiple ORDER but if i try to do the same to create multiple OBSERVATION (Line#8), I get the below error:
"Can't create repetition #1 of Structure OBSERVATION - this Structure is non-repeating"
As per HL7 specifications OBSERVATION is repeating structure, Anyone please help here?
Any pointers or any suggestions are greatly appreciated.
NHapi.Model.V25.Message.VXU_V04 vxuMsg = new VXU_V04();
PipeParser parser = new PipeParser();
for (int i = 0; i < person.Immunizations.Count; i++)
{
NHapi.Model.V25.Group.VXU_V04_ORDER orc = (NHapi.Model.V25.Group.VXU_V04_ORDER)vxuMsg.GetStructure("ORDER", i);
for (int j = 0; j < 2; j++)
{
NHapi.Model.V25.Group.VXU_V04_OBSERVATION observation = (NHapi.Model.V25.Group.VXU_V04_OBSERVATION)orc.GetStructure("OBSERVATION", j);
NHapi.Model.V25.Segment.OBX obx1 = (NHapi.Model.V25.Segment.OBX)obx.GetStructure("OBX");
}
NHapi.Model.V25.Segment.RXA im = orc.RXA;
NHapi.Model.V25.Segment.ORC oc = orc.ORC;
NHapi.Model.V25.Segment.RXR rxr = orc.RXR;
}
Required message outcome
MSH|^~\&|Test EHR Application|X68||NIST Test Iz Reg|201207010822||VXU^V04^VXU_V04|NIST-IZ-001.00|P|2.5.1|||AL|ER
PID|1||D26376273^^^NIST MPI^MR||Snow^Madelynn^Ainsley^^^^L|Lam^Morgan|20070706|F||2076-8^Native Hawaiian or Other Pacific Islander^CDCREC|32 Prescott Street Ave^^Warwick^MA^02452^USA^L||^PRN^PH^^^657^5558563|||||||||2186-5^non Hispanic or Latino^CDCREC
PD1|||||||||||02^Reminder/Recall - any method^HL70215|||||A|20120701|20120701
NK1|1|Lam^Morgan^^^^^L|MTH^Mother^HL70063|32 Prescott Street Ave^^Warwick^MA^02452^USA^L|^PRN^PH^^^657^5558563
ORC|RE||IZ-783274^NDA|||||||I-23432^Burden^Donna^A^^^^^NIST-AA-1||57422^RADON^NICHOLAS^^^^^^NIST-AA-1^L
RXA|0|1|20120814||140^Influenza, seasonal, injectable, preservative free^CVX|0.5|mL^MilliLiter [SI Volume Units]^UCUM||00^New immunization record^NIP001|7832-1^Lemon^Mike^A^^^^^NIST-AA-1|^^^X68||||Z0860BB|20121104|CSL^CSL Behring^MVX|||CP|A
RXR|C28161^Intramuscular^NCIT|LD^Left Arm^HL70163
OBX|1|CE|64994-7^Vaccine funding program eligibility category^LN|1|V05^VFC eligible - Federally Qualified Health Center Patient (under-insured)^HL70064||||||F|||20120701|||VXC40^Eligibility captured at the immunization level^CDCPHINVS
OBX|2|CE|30956-7^vaccine type^LN|2|88^Influenza, unspecified formulation^CVX||||||F
OBX|3|TS|29768-9^Date vaccine information statement published^LN|2|20120702||||||F
OBX|4|TS|29769-7^Date vaccine information statement presented^LN|2|20120814||||||F
Dim vxuMsg As NHapi.Model.V25.Message.VXU_V04 = New VXU_V04()
Dim orc As NHapi.Model.V25.Group.VXU_V04_ORDER = DirectCast(vxuMsg.GetStructure("ORDER", 0), NHapi.Model.V25.Group.VXU_V04_ORDER)
Dim observation As NHapi.Model.V25.Group.VXU_V04_OBSERVATION = orc.GetOBSERVATION(0) 'DirectCast(orc.GetStructure("OBSERVATION", 0), NHapi.Model.V25.Group.VXU_V04_OBSERVATION)
Dim orderobservation As VXU_V04_ORDER = vxuMsg.GetORDER(0)
Dim obx1 As NHapi.Model.V25.Segment.OBX = DirectCast(observation.GetStructure("OBX"), NHapi.Model.V25.Segment.OBX)
obx1 = orderobservation.GetOBSERVATION(0).OBX
obx1.SetIDOBX.Value = "1"
obx1.ValueType.Value = "CE"
obx1.ObservationIdentifier.Identifier.Value = "64994-7"
obx1.ObservationIdentifier.Text.Value = "Vaccine funding program eligibility category"
obx1.ObservationIdentifier.NameOfCodingSystem.Value = "LN"
obx1.ObservationSubID.Value = "1"
Dim ce As New CE(oru01)
ce.Identifier.Value = "V05"
ce.Text.Value = "VFC eligible - Federally Qualified Health Center Patient(under-insured)"
ce.NameOfCodingSystem.Value = "HL70064"
obx1.GetObservationValue(0).Data = ce
obx1.ObservationResultStatus.Value = "F"
obx1.DateTimeOfTheObservation.Time.Value = "20120701"
obx1.GetObservationMethod(0).Identifier.Value = "VXC40"
obx1.GetObservationMethod(0).Text.Value = "Eligibility captured at the immunization level"
obx1.GetObservationMethod(0).NameOfCodingSystem.Value = "CDCPHINVS"
Dim obx2 As NHapi.Model.V25.Segment.OBX = obx1
obx2 = orderobservation.GetOBSERVATION(1).OBX
obx2.SetIDOBX.Value = "2"
obx2.ValueType.Value = "CE"
obx2.ObservationIdentifier.Identifier.Value = "30956-7"
obx2.ObservationIdentifier.Text.Value = "vaccine type"
obx2.ObservationIdentifier.NameOfCodingSystem.Value = "LN"
obx2.ObservationSubID.Value = "2"
Dim ce2 As New CE(oru01)
ce2.Identifier.Value = "88"
ce2.Text.Value = "Influenza, unspecified formulation"
ce2.NameOfCodingSystem.Value = "CVX"
obx2.GetObservationValue(0).Data = ce2
obx2.ObservationResultStatus.Value = "F"
Dim obx3 As NHapi.Model.V25.Segment.OBX = obx1 'DirectCast(observation.GetStructure("OBX"), NHapi.Model.V251.Segment.OBX)
obx3 = orderobservation.GetOBSERVATION(2).OBX
obx3.SetIDOBX.Value = "3"
obx3.ValueType.Value = "TS"
obx3.ObservationIdentifier.Identifier.Value = "29768-9"
obx3.ObservationIdentifier.Text.Value = "Date vaccine information statement published"
obx3.ObservationIdentifier.NameOfCodingSystem.Value = "LN"
obx3.ObservationSubID.Value = "2"
Dim ts3 As New TS(oru01)
ts3.Time.Value = "20120702"
obx3.GetObservationValue(0).Data = ts3
obx3.ObservationResultStatus.Value = "F"