Cardiac arrests are more deadly on weekends
by HealthDay NewsYour odds of surviving a cardiac arrest long enough to be admitted to the hospital are lower on the weekend than on a weekday, researchers say.
For the study, the investigators analyzed data from nearly 3,000 patients worldwide who suffered an out-of-hospital cardiac arrest and were treated with a publicly accessible automated external defibrillator (AED).
Overall, 27 percent of the patients survived to hospital admission, a rate that matches previous studies.
But those whose cardiac arrest occurred between 12 a.m. Saturday and 11:59 p.m. Sunday were about 20 percent less likely to survive to hospital admission than those who were stricken between Monday and Friday.
The odds were also lower for older patients and those whose cardiac arrest occurred at home, the findings showed.
"It is often said that sudden cardiac arrest can happen to anyone, anytime, anywhere. These results suggest that there is an opportunity to address sudden cardiac arrests that occur during the weekend by improving AED awareness, availability and training, and quick response by rescuers," lead author Hannah Torney said in an American Heart Association (AHA) news release. Torney is a doctoral student at Ulster University in Northern Ireland.
Weekend survival odds may be lower because people could be less likely to be near a publicly accessible AED, and others may not witness the event, the study authors suggested.
The researchers said their findings could help guide placement of AEDs to improve accessibility.
The preliminary research is to be presented at the American Heart Association annual meeting, in Philadelphia, Nov. 16 to 18. Research presented at meetings should be considered preliminary until published in a peer-reviewed journal.
More information
The American Heart Association has more on cardiac arrest.
Copyright 2019 HealthDay. All rights reserved.
(0) Leave a comment
upi.com/6957726
Latest Headlines
Health News // 19 minutes ago
Heart attack survivors at greater risk for developing cancer
People who suffered a heart health scare -- a heart attack, heart failure or a dangerously erratic heart rhythm -- had a more than sevenfold increased risk for subsequently developing cancer, a new study found.
Health News // 1 hour ago
Study finds Americans can't lose weight, even though they try
Nov. 13 (UPI) -- More and more Americans are trying to lose weight, but few are finding success, according to a new study showing that increases in weight and weight gain are matching increases in adherence to weight loss regimens.
Health News // 3 hours ago
Older bike riders see increase in injuries, study says
Nov. 13 -- As more people have started riding bicycles over the last decade, injuries have increased as well -- with 55- to 65-year-olds seeing a more than 50 percent increase in trips to the ER.
Health News // 20 hours ago
Teen vaping victim undergoes double lung transplant
Nov. 12 (UPI) -- A 17-year-old male sickened by a THC-containing e-cigarette, one of scores across the U.S. diagnosed with respiratory illness, underwent a successful double lung transplant in October, doctors announced today.
Health News // 20 hours ago
Needle exchange programs prevent HIV infections
Needle exchange programs in two large U.S. cities prevented thousands of new HIV infections and saved hundreds of millions of dollars, researchers say.
Health News // 20 hours ago
Artificial intelligence uses electrocardiograms to predict arrhythmia
In two studies, artificial intelligence was used with electrocardiogram (ECG) results to identify patients who are at increased risk for a potentially dangerous irregular heartbeat.
Health News // 22 hours ago
Ultra-processed foods linked with higher risk of heart disease
If you opt for ultra-processed foods a lot, you may pick up something you don't want -- heart disease, a new study found, noting that the more calories that came from ultra-processed foods, the worse heart health was.
Health News // 1 day ago
Three-quarters of people survive heart transplant for at least five years, study says
Nov. 12 (UPI) -- Researchers report that roughly three quarters of heart transplant candidates who receive a new heart survive for five years after surgery, as opposed to the 33 percent who do not receive hearts surviving for five years.
Health News // 1 day ago
Eating late may mean higher heart disease risk for women
Nov. 11 -- Late dinners and heavy evening snacking may increase women's risk for heart disease, according to researchers at New York City's Columbia University.
Health News // 2 days ago
How fellow soldiers die affects veterans' grief
New research suggests that how comrades died can affect levels of grief among soldiers who served in Afghanistan and Iraq.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.validator.ValidatorResources
General purpose class for storing FormSet
objects based
on their associated Locale
. Instances of this class are usually
configured through a validation.xml file that is parsed in a constructor.
Note - Classes that extend this class must be Serializable so that instances may be used in distributable application server environments.
The use of FastHashMap is deprecated and will be replaced in a future release.
| Field Summary | |
protected FormSet |
defaultFormSet
This is the default FormSet (without locale). |
protected static java.util.Locale |
defaultLocale
The default locale on our server. |
protected org.apache.commons.collections.FastHashMap |
hActions
Deprecated. Subclasses should use getActions() instead. |
protected org.apache.commons.collections.FastHashMap |
hConstants
Deprecated. Subclasses should use getConstants() instead. |
protected org.apache.commons.collections.FastHashMap |
hFormSets
Deprecated. Subclasses should use getFormSets() instead. |
| Constructor Summary | |
ValidatorResources()
Create an empty ValidatorResources object. |
|
ValidatorResources(java.io.InputStream in)
Create a ValidatorResources object from an InputStream. |
|
ValidatorResources(java.io.InputStream[] streams)
Create a ValidatorResources object from an InputStream. |
|
ValidatorResources(java.lang.String uri)
Create a ValidatorResources object from an uri |
|
ValidatorResources(java.lang.String[] uris)
Create a ValidatorResources object from several uris |
|
ValidatorResources(java.net.URL url)
Create a ValidatorResources object from a URL. |
|
ValidatorResources(java.net.URL[] urls)
Create a ValidatorResources object from several URL. |
| Method Summary | |
void |
addConstant(java.lang.String name,
java.lang.String value)
Add a global constant to the resource. |
void |
addFormSet(FormSet fs)
Add a FormSet to this ValidatorResources
object. |
void |
addValidatorAction(ValidatorAction va)
Add a ValidatorAction to the resource. |
protected java.lang.String |
buildKey(FormSet fs)
Builds a key to store the FormSet under based on it's
language, country, and variant values. |
protected java.util.Map |
getActions()
Returns a Map of String ValidatorAction names to their ValidatorAction. |
protected java.util.Map |
getConstants()
Returns a Map of String constant names to their String values. |
Form |
getForm(java.util.Locale locale,
java.lang.String formKey)
Gets a Form based on the name of the form and the
Locale that most closely matches the Locale
passed in. |
Form |
getForm(java.lang.String language,
java.lang.String country,
java.lang.String variant,
java.lang.String formKey)
Gets a Form based on the name of the form and the
Locale that most closely matches the Locale
passed in. |
protected java.util.Map |
getFormSets()
Returns a Map of String locale keys to Lists of their FormSets. |
ValidatorAction |
getValidatorAction(java.lang.String key)
Get a ValidatorAction based on it's name. |
java.util.Map |
getValidatorActions()
Get an unmodifiable Map of the ValidatorAction s. |
void |
process()
Process the ValidatorResources object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.apache.commons.collections.FastHashMap hFormSets
Map
of FormSet
s stored under
a Locale
key.protected org.apache.commons.collections.FastHashMap hConstants
Map
of global constant values with
the name of the constant as the key.protected org.apache.commons.collections.FastHashMap hActions
Map
of ValidatorAction
s with
the name of the ValidatorAction
as the key.protected static java.util.Locale defaultLocale
protected FormSet defaultFormSet
FormSet
(without locale). (We probably don't need
the defaultLocale anymore.)| Constructor Detail |
public ValidatorResources()
public ValidatorResources(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
in
- InputStream to a validation.xml configuration file. It's the client's
responsibility to close this stream.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML files are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML filespublic ValidatorResources(java.io.InputStream[] streams) throws java.io.IOException, org.xml.sax.SAXException
streams
- An array of InputStreams to several validation.xml
configuration files that will be read in order and merged into this object.
It's the client's responsibility to close these streams.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML files are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML filespublic ValidatorResources(java.lang.String uri) throws java.io.IOException, org.xml.sax.SAXException
uri
- The location of a validation.xml configuration file.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML files are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML filespublic ValidatorResources(java.lang.String[] uris) throws java.io.IOException, org.xml.sax.SAXException
uris
- An array of uris to several validation.xml
configuration files that will be read in order and merged into this object.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML files are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML filespublic ValidatorResources(java.net.URL url) throws java.io.IOException, org.xml.sax.SAXException
url
- The URL for the validation.xml
configuration file that will be read into this object.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML file are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML filespublic ValidatorResources(java.net.URL[] urls) throws java.io.IOException, org.xml.sax.SAXException
urls
- An array of URL to several validation.xml
configuration files that will be read in order and merged into this object.java.io.IOException
- org.xml.sax.SAXException
- if the validation XML files are not valid or well
formed.java.io.IOException
- if an I/O error occurs processing the XML files| Method Detail |
public void addFormSet(FormSet fs)
FormSet
to this ValidatorResources
object. It will be associated with the Locale
of the
FormSet
.fs
- The form set to add.public void addConstant(java.lang.String name, java.lang.String value)
name
- The constant name.value
- The constant value.public void addValidatorAction(ValidatorAction va)
ValidatorAction
to the resource. It also creates an
instance of the class based on the ValidatorAction
s
classname and retrieves the Method
instance and sets them
in the ValidatorAction
.va
- The validator action.public ValidatorAction getValidatorAction(java.lang.String key)
ValidatorAction
based on it's name.key
- The validator action key.public java.util.Map getValidatorActions()
Map
of the ValidatorAction
s.protected java.lang.String buildKey(FormSet fs)
FormSet
under based on it's
language, country, and variant values.fs
- The Form Set.public Form getForm(java.util.Locale locale, java.lang.String formKey)
Gets a Form
based on the name of the form and the
Locale
that most closely matches the Locale
passed in. The order of Locale
matching is:
locale
- The Locale.formKey
- The key for the Form.public Form getForm(java.lang.String language, java.lang.String country, java.lang.String variant, java.lang.String formKey)
Gets a Form
based on the name of the form and the
Locale
that most closely matches the Locale
passed in. The order of Locale
matching is:
language
- The locale's language.country
- The locale's country.variant
- The locale's language variant.formKey
- The key for the Form.public void process()
ValidatorResources
object. Currently sets the
FastHashMap
s to the 'fast' mode and call the processes
all other resources. Note : The framework calls this
automatically when ValidatorResources is created from an XML file. If you
create an instance of this class by hand you must call
this method when finished.protected java.util.Map getFormSets()
protected java.util.Map getConstants()
protected java.util.Map getActions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


--- layout: post title: "Types + Properties = Software: other properties" description: "Even simple functions may have properties that can be expressed independently of the implementation." date: 2016-02-19 08:59 UTC tags: [Unit Testing, F#] --- {% include JB/setup %}
{{ page.description }}
This article is the eighth in a series of articles that demonstrate how to develop software using types and properties. In previous articles, you've seen an extensive example of how to solve the Tennis Kata with type design and Property-Based Testing. Specifically, in the third article, you saw the introduction of a function called other
. In that article we didn't cover that function with automatic tests, but this article rectifies that omission.
The source code for this article series is available on GitHub.
The other
function is used to find the opponent of a player. The implementation is trivial:
let other = function PlayerOne -> PlayerTwo | PlayerTwo -> PlayerOne
Unless you're developing software where lives, or extraordinary amounts of money, are at stake, you probably need not test such a trivial function. I'm still going to show you how you could do this, mostly because it's a good example of how Property-Based Testing can sometimes help you test the behaviour of a function, instead of the implementation.
Before I show you that, however, I'll show you why example-based unit tests are inadequate for testing this function.
You could test this function using examples, and because the space of possible input is so small, you can even cover it in its entirety:
[<Fact>] let ``other than playerOne returns correct result`` () = PlayerTwo =! other PlayerOne [<Fact>] let ``other than playerTwo returns correct result`` () = PlayerOne =! other PlayerTwo
The =!
operator is a custom operator defined by Unquote, an assertion library. You can read the first expression as player two must equal other than player one.
The problem with these tests, however, is that they don't state anything not already stated by the implementation itself. Basically, what these tests state is that if the input is PlayerOne, the output is PlayerTwo, and if the input is PlayerTwo, the output is PlayerOne.
That's exactly what the implementation does.
The only important difference is that the implementation of other
states this relationship more succinctly than the tests.
It's as though the tests duplicate the information already in the implementation. How does that add value?
Sometimes, this can be the only way to cover functionality with tests, but in this case, there's an alternative.
Property-Based Testing inspires you to think about the observable behaviour of a system, rather than the implementation. Which properties do the other
function have?
If you call it with a Player value, you'd expect it to return a Player value that's not the input value:
[<Property>] let ``other returns a different player`` player = player <>! other player
The <>!
operator is another custom operator defined by Unquote. You can read the expression as player must not equal other player.
This property alone doesn't completely define the behaviour of other
, but combined with the next property, it does:
[<Property>] let ``other other returns same player`` player = player =! other (other player)
If you call other
, and then you take the output of that call and use it as input to call other
again, you should get the original Player value. This property is an excellent example of what Scott Wlaschin calls there and back again.
These two properties, together, describe the behaviour of the other
function, without going into details about the implementation.
You've seen a simple example of how to describe the properties of a function without resorting to duplicating the implementation in the tests. You may not always be able to do this, but it always feels right when you can.
If you're interested in learning more about Property-Based Testing, you can watch my introduction to Property-based Testing with F# Pluralsight course.


{% from 'analytics/navigation.html' import navigation %} {% from 'analytics/css_import.html' import css_import %} {% from 'analytics/js_import.html' import js_import %}
PhotoPro helps professional photographers, online marketers, and social media-savy amateurs predict how much attention their photo will get.
Below you see the how individual images perform. The vast majority of the Flickr images analyzed recieved less than 70 views. Beyond that, however, a significant portion of images perform far better, receiving view totals in excess of 150 and even 300. These high-performers represent the most eye-catching pictures on Flickr. Can your submissions do as well?
A significant portion of Flickr's user base has pro accounts. The sample of images analyzed actually contain more pro images than non-pro. The models here have been trained to predict whether a photo is submitted by a pro account.
In addition to predicting views that an image can collect, several models have been trained on total user views. The distribution of total views that users recieve is much more normal than that for image views.


--- title: logm sidebar: function_reference_sidebar permalink: orientation.logm.html folder: function_reference toc: false ---
the logarithmic map that translates a rotation into a spin tensor
| mori | misorientation |
| ori | orientation |
| ori_ref | orientation |
| Omega | spinTensor |


Goofs/Gaffs
Ethan Bradberry
Hey That's Pretty Good!
I'm not your mother!

Another one!
OUCH!!!


What is this?
This is a private Minecraft server where the kids can play online with their friends in a closed, safe, and moderated environment. Only players we know are allowed to join at this time.
This server is different from other Minecraft servers because:
- It is run by a parent:
The server is maintained by a parent who knows and plays Minecraft. - Nobody joins without permission:
Players must be approved to join the server, meaning every person your kid encounters is somebody they already know from school. There are no strangers. - There are rules:
The admin takes a strong position against griefing and bullying in the game. If it happens, parents will be notified. If it is really bad, the player may be temporarily or permanently banned.
The goal is to provide a place where kids can learn the basic etiquette of online gaming, but in an environment that parents can trust. By playing with friends they see daily, the kids will have a better understanding of what online behavior is appropriate (and what is not).
In other words, this server provides a tangible lesson that every player in an online game is also a real person, with real emotions that are affected by what they say and do - for better or worse.
Scroll down for setup instructions, and learn how to request that your player be added.
Setup
To join the server you need to purchase and install Minecraft Java Edition on a Mac or PC, and send your username to the admin. Here's how you do that:
- Get a minecraft.net username:
You will need to create an account on minecraft.net and pay for a license for Minecraft: Java Edition. The license costs a one-time fee of $26.95. - Download and install Minecraft Java
Edition:
You will need to install this specific version of Minecraft. Minecraft Bedrock Edition (what you find on an iPad, Xbox, Switch, and Windows 10) won't work, because it's a different game. Instead, you need to download and install Minecraft: Java Edition for your computer. It works with Windows, Mac, and Linux. - Log into Minecraft:
When you start Minecraft it will ask for a username and password. You will use the same one you just registered on minecraft.net to buy the license. - Send your username to the admin:
The admin needs to add your username to the list of allowed players. Either email it, or send it to school on a piece of paper. All the admin needs is the username (not the password), and a parent's email so he can send the final setup instructions.
Rules of the game
Each player must follow the rules of the server.
- Respect is everything. Absolutely no bad language, trash talk, or teasing. This isn't ok in our home and it's not ok on this server. The server keeps transcripts of players' chats with each other. Players who do this will be temporarily blocked, and their parents notified.
- No griefing. Griefing is anything intentionally done to
frustrate another player. The goal is cooperative play. Minecraft can be
frustrating, but it should be because of the difficulty of the game rather than
another player's actions. Examples of griefing in Minecraft include:
- Stealing items from another player's chest.
- Destroying another player's creations without their permission.
- Creating TNT and lava traps.
- Setting fires around another player.
- Killing another player's pets or livestock
- Leaving doors open at night.
- Excluding other players.
- Staying awake when everybody else is sleeping.
- Bedtime is more important than the game. The server shuts down at 8pm each night, and restarts at 8am the following morning. Each parent can set whatever limits they see fit, but our kids get 30 minutes per day during the week, and an hour on the weekend.
Some tips for players
When you begin, you can't break blocks. You should move away from that area before building your first house.
Ender chests are a way to save your special items where no other player can access your stuff. We'll keep one near the place where players enter the game.
The server shuts down at bedtime, and everything is saved automatically. When you reconnect you'll be right where you stopped.
All players must be in a bed to skip the night. If you don't have a bed, disconnect from the game for a minute when someone says "Sleep". When you reconnect to the server, it will be morning.
If you join the game and it's the middle of the night, don't panic. Disconnect, wait 7 minutes, and connect again and it'll be daytime.
Some tips for parents
It's easy for kids to get into all-Minecraft, all-the-time mode. If you want a primer on it, ask the admin.
A lot of kids use Minecraft like virtual Legos. This is Creative mode. At some point, they may want to switch to Survival mode. We run both types of games, and joining another game type means disconnecting from the current game and joining another. Unlike in single-player, you can't change the game type back and forth in the settings.
Sometimes kids really get upset over another player's actions, even to the point of tears. Often the other player thinks they're only playing. If this happens, don't wait to say something to the admin.
The server is backed up periodically. If something really bad happens, like a painstakingly created construction is destroyed by another player, it is possible to roll back to yesterday's version of the game. This means everything that was done that day is lost, but sometimes that's needed for things to be made right.
If you have any questions or concerns at all, ask.


upload-your-waifu
Home
upload-your-waifu
💘 A repository to learn git and CLI easily by uploading your waifu's pictures.
Search Waifu Pictures
Submit


History is etched in every corner of the city of Chennai. While the city was the seat of power for many South Indian kingdoms through the ages, the documented history of the city began in the colonial times when the British stepped on the shores of Chennai and settled with the establishment of Fort St. George in1644. Chennai played a theatre of battle between the British, and the French colonial forces and also the kingdom of Mysore. Subsequently.
Chennai has the third-largest expatriate population in India at 35,000 in 2009, 82,790 in 2011 and estimated at over 100,000 by 2016.
The Chennai Metropolitan Area (CMA) comprises the city of Chennai, 16 Municipalities, 20 Town Panchayats and 214 Village Panchayats in 10 Panchayat Unions. The extent of CMA is 1189 km2.
Chennai has a tropical wet and dry climate. The city lies on the thermal equator and is also on the coast, which prevents extreme variation in seasonal temperature.
Madras Bashai evolved largely during the past three centuries.Many of these words were introduced by educated, middle class Tamil migrants to the city who borrowed freely from English for their daily usage.
Since the late 1990s , software development and business process outsourcing and more recently electronics manufacturing have emerged as major drivers of the city's economic growth.
Chennai is the capital city of the South Indian state of Tamil Nadu and is the fourth largest metropolitan city in the country. A total of 29% of Chennai population resided in slums as of 2011. The state government of Tamil Nadu has established a Slum clearance Board, with a minister heading it.
As of the provisional population totals of 2001, the slums in Chennai 10,79,414 persons, which constituted 25.6% of the total population of the city. Madurai and Trichy had 19% and 22% of the population living in slums. Out of the totals in Chennai, 548,517 were males and rest were 530,897 females. The child sex ratio was 968 females to every 1,000 males compared to the non-slum sex-ratio of 945.
The literacy rate of the slum population was 80.09% with 85.77% in males and 74.21% in females. There were a total of 125,725 households constituting 81,128 permanent (64.53%), 22,415 semi-permanent (17.83%) and 22,182 temporary households (17.64%). 66.96% of houses had single rooms, 24.19% had two, 5.85% had three and 2.17% had more than three rooms.


By popular demand, here is another verse by a sulky Bulgarian poet, written circa 1982. This one is entitled O, Little Radish and purports to be by Fratsin K Yecebit. (My poets' names sound Turkish rather than Bulgarian, but I was young, so young …)
Tomorrow morning we will
Drink vinegar
Here in this trench.
I haven't paid
Any of my debts
And I don't intend to.
They can brandish guns at me
Or twigs.
I'll make my peace
And whip it up with a whisk.
Send me your cash now.
Send me the lot.
I'm the man you ought to
Shove in the vat.


Button classes applied to different elements.
The button classes can be used on
<a>
,
<button>
, and
<input>
Link Button
Button


[CHAPTER 58]
EXCEPTIONAL TREES
Section
58-1 Purpose
58-2 County arborist advisory committees; establishment
58-3 County arborist advisory committees; powers and duties
58-4 County protective regulations
58-5 State assistance


Any new replays added to your Accounts folder
will be uploaded to zephyrus.gg.
If your Account folder does not match the default
location, please manually set it to the correct directory.
Replay uploads will take a few seconds to start up. The 100 most recent
replays will take a few minutes to complete.
Closing the window will minimize the application to the tray. Uploads will continue
running in the background.
To close the application, right-click on the tray icon.
Auto-Uploader


| DOSE: |
42 mg |
oral |
AMT |
(powder / crystals) |
First of all, AMT is wonderful.  Anyway, on with the story...
I took the gelcap at 11am on a Saturday morning. I was spending the day with my girlfriend (but she didn't have any, she's little scared of these things). It took forever to feel anything, at about 2pm I got some real strange pain in my stomach, it was quite uncomfortable. I wasn't feeling anything else at this point and I decided I needed some pot. What a great idea that was, every cone felt so good and after 5 of them, my stomach pain was gone and I started to feel quite euphoric.
My girlfriend wanted to go shopping, so we headed off to the shopping center. I was feeling like I could handle it but it kept getting stronger and stronger. I noticed that my hearing was super-sensitive and I isolate a certain sound out of the 1000's that were going on. My eyes were getting a bit sensitive too, everything was so bright.
It's about 4:30pm now, we leave the mall and go for a drive. The wind felt good and I was quite enjoying just driving around, still no visual activity though. Then something bad happened, on the way home we got caught in a traffic jam and that bummed me out a bit. Setting has a huge impact of this drug. Not to worry too much though because it only held us up for about 30mins.
We got home at about 6:30 and I had a couple of cones, moment later the experience got extremely psychedelic. Tracers, patterns, things melting and flowing, I've never seen anything like it. This was in candlelight though, bright like sort of overpowered the visuals and was hard to handle but soft light was warm, gentle, visual and comforting. Time dilution was amazing too, minutes seemed like hours and hours would feel like minutes. Contrary to what I expected the euphoric and empathic quality of AMT didn't disappear when the visual came in, they got a little lighter but were still a definite part of the experience.
It was then like I was transformed into Don Juan, I was saying such beautiful, truthful and poetic things to my girlfriend. She really is very beautiful and I do love her very much, the emotions, words and actions didn't feel endued by the AMT, they felt revealed by it. I thought myself to explore every part of her body, making love for hours like you wouldn't believe. I was so connected with her, a number of times I would feel like she had communicated with me telepathically and when I asked her if that was what she was just thinking, I got it %100 right like %90 of the time. Sex wasn't that important though, I was just as happy just kissing and rubbing against her.
Well, that's the end of the interesting stuff.  Oh, and you really need some relaxing drug for the very end of it, I used Xanax and a little codeine. I saw some really freaking things that night (especially in the mirror) and if I hadn't prepared myself mentally so well, I most probably would have freaked out but if you embrace it, it'll be nice to you... I can't wait to try a little more.
Be prepared,
The Director
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


so i wanted to spend the night to prep emoncms for the pi instead of feeding through the cable to the meter box...(to monitor the blinker)
http://emoncms.org/site/docs/raspberrypihdd
the links in there are wrong... at least for the DK ones...
it then links to https://github.com/emoncms/emoncms/tree/bufferedwrite
but i dont like buffered writes and the page that comes up are not nearly as clean.... but if this is the only page to follow i will have to make do
are the HDD image not supported and updated anymore?
Re: Latest SD+HDD software?
what is the latest SD+HDD software?
Re: Latest SD+HDD software?
is the latest still 23 of Feb 2014 ?
Re: Latest SD+HDD software?
Hello boelle, for HDD's I would recommend using the latest low write SD card image (emonSD-13-08-14.img.zip) and then applying the HDD modifications as detailed on the linked page on the low write SD card emoncms readme here: https://github.com/emoncms/emoncms/blob/bufferedwrite/readme.md
Re: Latest SD+HDD software?
Using the low write SD card image with a harddrive will still benefit the longevity of your harddrive. You can though if you wish switch to the full master branch of emoncms following the documentation page here: https://github.com/emoncms/emoncms/blob/bufferedwrite/docs/switchtofull.md
Re: Latest SD+HDD software?
ok... makes a bit more sense now...
will the low write version spin down the hard drive? or how does it work on a harddrive?
Re: Latest SD+HDD software?
It will just reduce the write rate to the harddrive. By default it writes the data once a minute, in larger blocks than it would otherwise do. You could slow that write rate down even further if you wanted to (5, 10mins). There more on what its doing and the investigation I did here: https://github.com/openenergymonitor/documentation/blob/master/BuildingB...
Re: Latest SD+HDD software?
ok.. will read up on it later....
but i wonder if you plan to make a SD+HDD version of this ? would be more easy for windows users :-D
and maybe add the spin down part as that would really prolong the life (bearings tend to break faster the more they run...)
just thoughts... :-D
Re: Latest SD+HDD software?
so i got the image loaded and changed so it now runs of hdd...
but nothing happens when i visit the ip of the pi.... is there something i'm missing?
Re: Latest SD+HDD software?
from ssh i issued
localemoncms-enable
and
rpi-rw
now i can get to emoncms with default login
but there is no option to config the RFM12 module... and if i try to create a user of the name "boelle" it says its allready there...
what did i do wrong?
Re: Latest SD+HDD software?
now i cant login at all....
trying with: admin/raspberry and raspberry/raspberry
Re: Latest SD+HDD software?
pi/raspberry ?
Re: Latest SD+HDD software?
will start a new thread so things are not mixed up
Re: Latest SD+HDD software?
hehe... will try that one... but the docs said the other 2
Re: Latest SD+HDD software?
hehe... will try that one... but the docs said the other 2
Re: Latest SD+HDD software?
nope did not work
Re: Latest SD+HDD software?
started new thread here on login issue: http://openenergymonitor.org/emon/node/5797
Re: Latest SD+HDD software?
I decided to go for the full deal as i want to use the pi for more than just emoncms...
got to here: https://github.com/emoncms/emoncms/blob/master/docs/DebianInstall.md#install-pecl-modules-serial-redis-and-swift-mailer
it says: "For instructions, see the general Linux installation steps below."
only there are not any install steps below... or does it mean the section with git commands? in that case which one is serial?
as i use a hdd i dont care for redis etc...
Re: Latest SD+HDD software?
almost there...
in emocms i'm now greeted with: No data has been recieved from the RFM12Pi in the last 30s. Check if the Pi interface script is running, if not you may need to configure cron
running: Powered by openenergymonitor.org | v8.3.2
EDIT: used this guide: https://github.com/Dave-McCraw/pkg-emoncms/blob/master/docs/install.md
skipped:
sudo apt-get install redis-server
sudo pecl install redis swift/swift
sudo sh -c 'echo "extension=redis.so" > /etc/php5/apache2/conf.d/20-redis.ini'
sudo sh -c 'echo "extension=redis.so" > /etc/php5/cli/conf.d/20-redis.ini'
Re: Latest SD+HDD software?
running sudo service rfm12piphp start dont throw any errors.... but still it does not seem to be running from inside emoncms
i have done the edit so the serial port is free
Re: Latest SD+HDD software?
got output from minicom and the led on the RFM module is blinking...
will try and see if script is running
Re: Latest SD+HDD software?
added
*/1 * * * * root cd /usr/share/emoncms/www/Modules/raspberrypi && php raspberrypi_run.php
to crontab but did not help...
still in raspberry pi under emoncms:
No data has been recieved from the RFM12Pi in the last 30s. Check if the Pi interface script is running, if not you may need to configure cron
Re: Latest SD+HDD software?
pi@raspberrypi /usr/share/emoncms/www/Modules/raspberrypi $ sudo service rfm12piphp start
Log is turned off
Starting RPI
still the same in emoncms...
Re: Latest SD+HDD software?
pi@raspberrypi /usr/share/emoncms/www/Modules/raspberrypi $ sudo service rfm12piphp stop
Log is turned off
Stopping RPI: (raspberrypi_run.php was not running...)
stopped
so its not starting.... but why?
Re: Latest SD+HDD software?
probed at bit more in to it:
sudo php raspberrypi_run.php
PHP Fatal error: Class 'EmonLogger' not found in /usr/share/emoncms/www/Modules/user/user_model.php on line 34
Fatal error: Class 'EmonLogger' not found in /usr/share/emoncms/www/Modules/user/user_model.php on line 34
Re: Latest SD+HDD software?
Hi boelle
How did you install the RFM2Pi interface? via git or apt-get ? you have definatly only installed one, correct ?
Have you done both the edits so the serial port is free, inittab and cmdline.txt ?
The cron entry is not required in most cases, there should be a init file to start the service at start up.
EmonCMS's raspberrypi module and the emoncms-module-rfm2pi have both been retired as emonhub is intended to replace all previous options and simplifies things greatly.
Paul
Re: Latest SD+HDD software?
hi
via apt-get
yes both done so serial free
its not running...
look at my last 2 mails before this one... also i got output from minicom...
Re: Latest SD+HDD software?
emocms admin
LOG4PHP INSTALLED: no
could it be that?
Re: Latest SD+HDD software?
oh yes... remember that i dont run the lowwrite version anymore if that makes a difference...
Re: Latest SD+HDD software?
what things could i test to clear out possible faults at my end?
Re: Latest SD+HDD software?
so nothing i really can do to check if i screwed up on my part?
Re: Latest SD+HDD software?
got it at last.... i was prop told before but emonhub is now the bit that gets the data and passes it on.
now i just need to figure why bargraphs have 3 buttons with / in front and not the wire framework like other graphs
http://energymonitor-dk.dns4e.net/emoncms/boelle/
Re: Latest SD+HDD software?
will do a new thread on that...


<copyrfirst>
The <copyrfirst> element contains the copyright year, or the first copyright year within a multiyear copyright statement.
Category: Bookmap metadata elements


Places We Have Been
Add a place:
Name
Location
Year
Notes
Landmark Name
Landmark Description
Another Landmark
Add
Places:
Location:
Year:
Notes:
Landmarks:


The data of the model can also be loaded directly from the webapp directory. So we can define an item for each facelet matching buttons-item-*.xhtml. With this, we can create applications with pluggable UI. And we don't have to fight with bindings and creating components in Java code.
This example shows a flexible possiblility, but for most cases there are much simpler solutions.


In order to win you must choose the functions (actions in code) that you wish for your character to make. Your character must move to the red spot to save a the civilian and then move to the yellow enemy and attack when on top. Your actions are listed below. Don't hit the black obstacles or you will lose!


The Apartment (1960)
Grade: 54
Billy Wilder's "The Apartment" was an enormous success. Nominated for ten Academy Awards, it won five, including Best Picture and Best Director. Made as a comedy, the film appears much darker today. However, the stereotype of business executives as cynical, manipulative skirt-chasers strains credibility, and the actions of characters both major and minor is entirely predictable.
Jack Lemmon works long hours in an enormous office. It turns out that he stays late because he can't go home: he has allowed his corporate bosses to borrow his apartment for sessions with their mistresses. Lemmon is hoping for a promotion, which he finally obtains when he grants company bigshot Fred MacMurray exclusive access.
Meanwhile, Lemmon is attracted to winsome elevator operator Shirley MacLaine. His progress with her is limited, as she is MacMurray's mistress. When Lemmon discovers her secret, what will he do? This being a movie, he tells his boss off, walks away from his cushy job, and walks off into the sunset with his willing love interest. We are awaiting the sequel, which assumedly begins with Lemmon and MacLaine standing in the unemployment line.
Many scenes in "The Apartment" don't quite work. Why do these executives go to such trouble to use Lemmon's apartment, when they could get one of their own, or rent a hotel? MacMurray and his fellow bosses are excessively crass, and the office party is so wild that one expects the riot squad to show up. Lemmon's personality change from toadying underling to "mensch" is sudden yet predictable. MacLaine's hot-headed brother-in-law is an unfunny plot device to gain audience sympathy for chivalric Lemmon.
<EMAIL_ADDRESS>http://members.tripod.com/~Brian_Koller/movies.html
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


{% extends "page.html" %} {% block main %} {#
Powered by {# TODO add versions of jhub and bhub#} JupyterHub and BinderHub
Created by GESIS - Leibniz Institute for the Social Sciences, CSS group
{#TODO team + add dhurim. maybe we make a team page?#}
{# Team:
#}
{# Dr. Arnim Bleier#}
{#
#}
{# Kenan Erdogan#}
{#
#}
Contact: notebooks @gesis.org
or create an issue


Mozilla is cool
Answer is,
At Mozilla, we’re a global community of
technologists
thinkers
builders
First Number:
Second Number:
Change user


--- layout: post title: Some Help in Revit with Rhythm date: '2015-07-10T11:43:00.001-07:00' author: JohnP tags: modified_time: '2015-07-10T11:43:02.474-07:00' thumbnail: http://lh3.googleusercontent.com/-1ODaf8glL58/VaASM8jZ5WI/AAAAAAAAAY8/om4Yszulws0/s72-c/2015-07-10_12h40_15_thumb.png?imgmax=800 blogger_id: tag:blogger.com,1999:blog-8275462422374771907.post-8367703790462060747 blogger_orig_url: http://sixtysecondrevit.blogspot.com/2015/07/some-help-in-revit-with-rhythm.html ---
There’s a new update for Rhythm today. I included some pretty useful stuff that includes OS functions and some help (Ayuda)
These nodes also open up the possibility to skip file path nodes to determine various things in the current file.
Have fun!
-johnp


|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rosehulman.soar.datamap.items.DMItem
Abstract class to represent any item in the datamap. I probably should have named it DMAttribute, but it is far too late to change that now.
| Field Summary | |
protected java.lang.String |
_comment
|
protected java.lang.String |
_name
|
protected DMItem |
_parent
|
| Constructor Summary | |
DMItem()
The default constructor |
|
DMItem(java.lang.String name)
Creates a new DMItem with the given name. |
| Method Summary | |
boolean |
acceptsChildren()
Indicates whether the item can have children. |
void |
addChild(DMItem child)
Add a new item to this item's children. |
abstract boolean |
canEditValues()
Indicates whether this item's calues can be edited or not. |
abstract DMItem |
createNew()
Creates a new instance of this class of item |
abstract int |
editValuesDialog(WorkbenchPart parent)
Displays a dialog enabling the user to edit this item's values. |
java.util.ArrayList |
getChildren()
Returns an ArrayList of the children of this item. |
java.lang.String |
getComment()
Gets the comment associated with this item. |
java.lang.String |
getName()
Gets the item's name. |
DMItem |
getParent()
Returns the item's parent item in the datamap |
abstract java.lang.String |
getTypeName()
Returns a string indicating the type of this Item. |
abstract java.lang.String |
getXML(int depth)
Returns the XML for this item and all its children. |
boolean |
hasChildren()
Tells whether the item has any children or not. |
abstract int |
initValuesDialog(WorkbenchPart parent)
Displays a dialog enabling the user to initialize this item's values. |
void |
removeChild(DMItem child)
Remove a child from this item. |
void |
setChildren(java.util.ArrayList children)
Sets the item's children to the given ArrayList if the item supports children. |
void |
setComment(java.lang.String newComment)
Sets the comment associated with this item. |
void |
setName(java.lang.String newName)
Sets the item's name. |
void |
setParent(DMItem parent)
Sets the item's parent item in the datamap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String _name
protected java.lang.String _comment
protected DMItem _parent
| Constructor Detail |
public DMItem()
public DMItem(java.lang.String name)
name
- The name of the item.| Method Detail |
public java.util.ArrayList getChildren()
DMIdentifier
at this time.
public void setChildren(java.util.ArrayList children)
DMIdentifier
.
children
- The new ArrayList of children.public void addChild(DMItem child)
child
- The child to add to this item.public void removeChild(DMItem child)
child
- The child to be removedpublic boolean hasChildren()
DMIdentifier
can have children.
public boolean acceptsChildren()
DMIdentifier
can have children.
public DMItem getParent()
public void setParent(DMItem parent)
parent
- The item's new parentpublic java.lang.String getName()
public void setName(java.lang.String newName)
newName
- The new name of the item.public java.lang.String getComment()
public void setComment(java.lang.String newComment)
newComment
- The comment to be associated with this item.public abstract DMItem createNew()
public abstract java.lang.String getTypeName()
public abstract int initValuesDialog(WorkbenchPart parent)
parent
- The parent view of this new instance
public abstract boolean canEditValues()
public abstract int editValuesDialog(WorkbenchPart parent)
parent
- The parent view of this new instance
public abstract java.lang.String getXML(int depth)
depth
- How deep the item is in the tree. Used to
keep the file properly indented;
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


The CS Principles Quiz
Filtering Options
---------------
Big Ideas
Creativity
Abstraction
Data
Algorithms
Programming
Internet
Global Impact
---------------
Keyword or Unit Number
---------------
Source
Mobile CSP
College Board Sample Question
---------------
Randomize
Remove all filters
Keyword or Unit Number:
<<Previous
Next >>
| Load File:
Save File:
Create File
Add New Question
Save Question Changes
Quiz Data
Description:
Type:
CSP Code:
Source:
Heading:
Question:
Hint:
Wrong Feedback:
Choice1:
Score:
Feedback:
Choice2:
Score:
Feedback:
Choice3:
Score:
Feedback:
Choice4:
Score:
Feedback:
Preview
(
0/0
)
Hint
JSON:
x


Stranger Grove Fire Station
[10, 30]
|
the Sell Monument
[11, 30]
|
the Acott Arms
[12, 30]
|
Feaver Walk
[13, 30]
|
Vyse Row
[14, 30]
|
Paisley Road
[15, 30]
|
Maggs Bank
[16, 30]
|
Flemming Lane
[17, 30]
|
a junkyard
[18, 30]
|
the Sweeney Building
[19, 30]
|
Worner Crescent
[10, 31]
|
the Ackermen Hotel
[11, 31]
|
wasteland
[12, 31]
|
Ross Avenue School
[13, 31]
|
Chorley Drive
[14, 31]
|
the Oxley Building
[15, 31]
|
Whippey Place Fire Station
[16, 31]
|
a junkyard
[17, 31]
|
wasteland
[18, 31]
|
Bentley Cinema
[19, 31]
|
Tuchings Park
[10, 32]
|
a carpark
[11, 32]
|
Mather Bank
[12, 32]
|
Ker Way
[13, 32]
|
Curle Street Police Dept
[14, 32]
|
Pullin Square
[15, 32]
|
Damon Way
[16, 32]
|
St Lazar's Hospital
[17, 32]
|
a junkyard
[18, 32]
|
the Ayliffee Building
[19, 32]
|
Sroud Crescent
[10, 33]
|
Mears Auto Repair
[11, 33]
|
wasteland
[12, 33]
|
Goldsworthy Avenue
[13, 33]
|
Uppill Library
[14, 33]
|
Creese Way
[15, 33]
|
Ripley Park
[16, 33]
|
Hardstaff Bank
[17, 33]
|
the Caddick Monument
[18, 33]
|
Coss Cinema
[19, 33]
|
Help Bank
[10, 34]
|
Capper Alley Railway Station
[11, 34]
|
a junkyard
[12, 34]
|
Freeguard Walk
[13, 34]
|
Piegsa Place Police Dept
[14, 34]
|
Boon Crescent
[15, 34]
|
Nicols Plaza
[16, 34]
|
wasteland
[17, 34]
|
Griffen Square
[18, 34]
|
the McDougall Building
[19, 34]
|
the Travers Building
[10, 35]
|
the Tatchell Building
[11, 35]
|
St Tsarevna's Church
[12, 35]
|
Enright Boulevard
[13, 35]
|
the Gotch Museum
[14, 35]
|
the Gass Monument
[15, 35]
|
Bridgewater Drive
[16, 35]
|
Beel Boulevard
[17, 35]
|
Lockie Row
[18, 35]
|
Edgerton Drive
[19, 35]
|
the Fennessy Building
[10, 36]
|
Tibbs Row
[11, 36]
|
the Nolan Hotel
[12, 36]
|
Dorey Way
[13, 36]
|
wasteland
[14, 36]
|
a junkyard
[15, 36]
|
Mallard Library
[16, 36]
|
Duport Alley
[17, 36]
|
Bowle Place
[18, 36]
|
Kempthorne Cinema
[19, 36]
|
McDermott Park
[10, 37]
|
Graham Towers
[11, 37]
|
St Osyth's Church
[12, 37]
|
Ayre Place Railway Station
[13, 37]
|
Pownall Alley
[14, 37]
|
wasteland
[15, 37]
|
the Bawn Museum
[16, 37]
|
Farlow Drive School
[17, 37]
|
Ash Walk
[18, 37]
|
the Mitchener Monument
[19, 37]
|
Emes Walk
[10, 38]
|
Sevior Plaza
[11, 38]
|
a cemetery
[12, 38]
|
Dunstone Walk Fire Station
[13, 38]
|
Powers Avenue School
[14, 38]
|
Quaney Alley
[15, 38]
|
Doggrell Avenue
[16, 38]
|
a junkyard
[17, 38]
|
a carpark
[18, 38]
|
Swetman Park
[19, 38]
|
Urben Alley Fire Station
[10, 39]
|
the Cavill Building
[11, 39]
|
Cottam Way Police Dept
[12, 39]
|
the Flowar Building
[13, 39]
|
St Werburgh's Hospital
[14, 39]
|
Verrall Park
[15, 39]
|
Blaimen Street
[16, 39]
|
St Marcus's Church
[17, 39]
|
a cemetery
[18, 39]
|
Gibbins Towers
[19, 39]
|
|
Menu
City Map
Find Location
Route Finder
World View
Map Mirror
|


Taiwanese cargo ship sank after collision 2 crew missing
by Mikhail VoytenkoCargo ship CHANG XIN with 9 crew on board issued distress signal at 2150 Beijing time Nov 20, reporting sinking near Chuanshi Island, Minjiang River estuary, Fuzhou, China, Taiwan Strait waters. According to reports, the ship started to take in water and sank, after collision with unidentified vessel. Fujian MRCC sent SAR boats and helicopter to disaster site. In the morning Nov 21 helicopter spotted a life raft with 6 crew, 1 crew swam to the shore, 2 crew went missing.
Cargo ship CHANG XIN, MMSI 416374000, len gth 50 meters, flag Taiwan.


--- title: Backgrounds category: Element Types order: 1 ---
Background elements are simple elements that are always included in your watch face, and stay at the bottom of your layers.
The background image is similar to the custom 'image' element, except that it is always in your layer stack. This element allows advanced settings and tags to allow for dynamic backgrounds.
The background color is the default color that will be shown to a user if there are no other layers on top.


Spring Boot and H2 in memory database
This guide will help you understand the concept of in memory database. We will look at simple JPA example to understand the best practices in using in memory databases.
You will learn
- What is an in memory database?
- Why do you use an in memory database?
- What are the best practices in using an in memory database?
- How to connect a Spring Boot project to H2?
What is an in memory database?
Typical databases involve a lot of setup.
For example, with Oracle or mySQL databases, you would need to
- Install the Database
- Setup a Schema
- Setup the tables
- Populate the data
- Connect the application to the database by setting up a data source and a lot of other code
Scenario 1 - Let’s consider a situation where you would want to do a quick POC. Using a traditional database involves a lot of overhead.
Scenario 2 - Consider your unit tests
- You don’t want them to fail when some data/schema in the database changes
- You would want to be able to run them in parallel - multiple developers might be running the tests in parallel.
In these kind of scenarios, an in memory database provides an ideal solution.
An in memory database is created when an application starts up and destroyed when the application is stopped.
Advantages
- Zero project setup or infrastructure
- Zero Configuration
- Zero Maintainance
- Easy to use for Learning, POCs and Unit Tests
- Spring Boot provides Simple Configuration to switch between a real database and an in memory database like H2
H2
H2 is one of the popular in memory databases. Spring Boot has very good integration for H2.
From https://en.wikipedia.org/wiki/H2_(DBMS)
H2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode.
H2 supports a sub set of the SQL standard.
H2 also provides a web console to maintain the database.
Spring Boot and H2
You need very little configuration to connect Spring Boot application with H2.
In most situations, just adding the H2 runtime jar into dependencies should be sufficient.
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
Setting up a Spring Boot Project with H2
Spring Initializr http://start.spring.io/ is great tool to bootstrap your Spring Boot projects.
As shown in the image above, following steps have to be done
- Launch Spring Initializr and choose the following
- Choose
com.girishgodage.springboot.rest.example
as Group - Choose
spring-boot-2-jpa-with-hibernate-and-h2
as Artifact - Choose following dependencies
- Web
- JPA
- H2
- DevTools
- Choose
- Click Generate Project.
- Import the project into Eclipse. File -> Import -> Existing Maven Project.
Ensure that H2 is selected in the dependencies.
Create a simple Student Entity with a primary key id.
@Entity
public class Student {
@Id
@GeneratedValue
private Long id;
private String name;
private String passportNumber;
H2 - A Few Tips
- An in-memory database is live only during the time of execution of the application. It is an efficient way to learn a framework.
- This is not how you want your real world applications to behave.
- We explain how to connect to a database of your choice in the answer to the question “How do we connect to a external database?”.
Spring Boot and H2 Magic
H2 provides a web interface called H2 Console to see the data. Let’s enable h2 console in the application.properties.
/src/main/resources/application.properties
# Enabling H2 Console
spring.h2.console.enabled=true
When you start the application up now, you would see a lot of magic unfold!
When you reload the application, you can launch up H2 Console at http://localhost:8080/h2-console.
Tip - Make sure that you use
jdbc:h2:mem:testdb
as JDBC URL.
You will see that a new table called ‘student’ is created in H2 Console.
How did the Student table get created?
Its because of Spring Boot Auto Configuration. We will talk about this in the next section.
You can also populate some data into student table by adding a file called data.sql
/src/main/resources/data.sql
insert into student
values(10001,'Ranga', 'E1234567');
insert into student
values(10002,'Ravi', 'A1234568');
When you reload the application, you can launch up H2 Console to see that the student table is populated with the data from `data.sql’
- http://localhost:8080/h2-console.
How did all the magic happen? Let’s look at it question by question in the next section.
Frequently asked questions about Spring Boot, JPA, Hibernate and H2
Q : How does H2 and Spring Boot combination work?
First and most important thing - Spring Boot is intelligent.
If you are talking to an in memory db, by default, it looks at the entities and creates the database and the tables.
However, if you connect to a mysql database, Spring Boot knows that its a permanent database. By default, it expects you to set up the database, set up the tables and it uses the connection that you established.
Q : How did the Spring Boot Application connect to the database H2?
Its down to Spring Boot Auto Configuration!
First thing you would need to understand is Spring Boot Auto Configuration.
As far as H2 is concerned, as soon as Spring Boot sees H2 in the class path, it auto configures a data source similar to what you see below:
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
It knows that you are using an inmemory database H2 and it uses the default url if you don’t provide one.
Q : Where is the database connection info specified? How does it know to automatically connect to H2?
Thats Spring Boot Autoconfiguration magic.
From https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-auto-configuration.html
Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. For example, If HSQLDB is on your classpath, and you have not manually configured any database connection beans, then Spring Boot will auto-configure an in-memory database.
Q : What happens if H2 is not in the classpath?
You get this error
Cannot determine embedded database driver class for database type NONE
Add H2 to the pom.xml and Restart your server
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
Q : Why is the data lost between restart?
H2 is an in memory database. Its not a persisted database.
H2 is a great tool for learning because you need zero setup.
Error : Table is not created automatically in h2 embedded db or I’m unable to see the tables
Usually, the table’s are created but the url used in H2 GUI Console is wrong.
In the browser, change the database url to jdbc:h2:mem:testdb (Shown in the screen below).
You should be good to go!
Error : H2 Console is not Launched up?
Try enabling it in the application.properties
spring.h2.console.enabled=true
Q : How did the insert query from data.sql run at application startup?
That’s part of the Spring Boot startup routine. Any queries in data.sql are run at application startup. You can read more here.
- https://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html
Running H2 as a persisted database with Spring Boot
While we dont recommend this , it interesting to note that H2 has a persisted database mode
- With this configuration, the data is not lost even after spring boot restart and computer restart.
You would find H2 being very rarely used in this way. If you are really interested in a persistent database, we recommend exploring MySQL, Oracle or some other relational database.
application.properties
spring.datasource.name=yourdbname
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.initialize=false
spring.datasource.url=jdbc:h2:file:~/yourdbname;DB_CLOSE_ON_EXIT=FALSE;IFEXISTS=TRUE;DB_CLOSE_DELAY=-1;
spring.jpa.hibernate.ddl-auto = update
Using H2 for unit tests
The standard properties file that Spring Boot picks up automatically when running an application is called application.properties and resides in the src/main/resources folder.
If we want to use different properties for tests, then we can override the properties file in the main folder by placing another file with the same name in src/test/resources.
The application.properties file in src/test/resources folder should contain the standard key-value pairs necessary for configuring a in memory connection.
First add the dependencies for your database driver (mysql in the example below) and make the dependency for h2 test
scoped.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
Use the mysql database for your real code
src\main\resources\application.properties
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/person_example
spring.datasource.username=personuser
spring.datasource.password=YOUR_PASSWORD
Use in memory database for your unit tests
src\test\resources\application.properties
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
spring.datasource.username=sa
spring.datasource.password=sa


Functionality for developing and analyzing the output of health-economic simulation models. Contains random sampling functions for conducting probabilistic sensitivity analyses (Claxton et al. 2005) <doi:10.1002/hec.985> and individual patient simulations (Brennan et al. 2006) <doi:10.1002/hec.1148>. Individualized cost-effectiveness analysis (Basu and Meltzer 2007, Ioannidis and Garber 2011) <doi:10.1177/0272989X06297393>, <doi:10.1371/journal.pmed.1001058> can be performed on simulation output and used to summarize a probabilistic sensitivity analysis at the subgroup or individual level. Core functions are written in C++ to facilitate computationally intensive modeling.
| Version: | 0.1.0 |
| Depends: | R (≥ 3.2.3) |
| Imports: | data.table, Rcpp (≥ 0.12.9), stats |
| LinkingTo: | Rcpp, RcppArmadillo |
| Suggests: | covr, ggplot2, knitr, msm, rmarkdown, scales, testthat, truncnorm |
| Published: | 2017-12-03 |
| Author: | Devin Incerti [aut, cre] |
| Maintainer: | Devin Incerti <devin.incerti at gmail.com> |
| BugReports: | https://github.com/InnovationValueInitiative/hesim/issues |
| License: | GPL-3 |
| URL: | https://github.com/InnovationValueInitiative/hesim |
| NeedsCompilation: | yes |
| Materials: | README |
| CRAN checks: | hesim results |
| Reference manual: | hesim.pdf |
| Vignettes: |
Individualized cost-effectiveness analysis (iCEA) |
| Package source: | hesim_0.1.0.tar.gz |
| Windows binaries: | r-devel: hesim_0.1.0.zip, r-release: hesim_0.1.0.zip, r-oldrel: hesim_0.1.0.zip |
| OS X binaries: | r-release: hesim_0.1.0.tgz, r-oldrel: hesim_0.1.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=hesim to link to this page.


--- short: t-sparqlconstructchunked type: transformer color: indigo title: SPARQL construct chunked description: Transforms chunked RDF data using a SPARQL CONSTRUCT query. ---
Transformer, allows the user to transform chunked RDF data using a CONSTRUCT query. This means that based on the input data, output data will be generated using this query, preserving the data chunking.
The {{page.title}} component queries input data using a SPARQL CONSTRUCT query, producing new data on the output. This component works with chunked RDF data, executing the query separately on each chunk, which can save considerable amounts of resources, both time and consumed memory. It can be configured at runtime using RDF configuration, which can be generated by another component. Chunked RDF data is produced e.g. by Files to RDF chunked, SPARQL endpoint chunked or Tabular chunked.
Below you can see sample runtime configuration for the component. Note that RDF blank nodes are not allowed in runtime configurations.
{% highlight turtle %} @prefix sc:


Aftermath...


Class HatchCodes
The HatchGroupCodes. Dxflib.Entities.Hatch
Inherited Members
Namespace: Dxflib.IO
Assembly: Dxflib.dll
Syntax
public class HatchCodes : GroupCodesBase
Fields
| Improve this Doc View SourceAssociativityFlag
Associativity flag (0 = non-associative; 1 = associative); for MPolygon, solid-fill flag (0 = lacks solid fill; 1 = has solid fill)
Declaration
public const string AssociativityFlag = " 71"
Field Value
| Type | Description |
|---|---|
| System.String |
EdgeType
Edge Type (Only if boundary is not a polyline) 1 = Line 2 = Circular Arc 3 = Elliptical Arc 4 = Spline
Declaration
public const string EdgeType = " 72"
Field Value
| Type | Description |
|---|---|
| System.String |
HatchPatternAngle
Hatch Pattern Angle (pattern fill only)
Declaration
public const string HatchPatternAngle = " 52"
Field Value
| Type | Description |
|---|---|
| System.String |
HatchPatternName
Hatch pattern name
Declaration
public const string HatchPatternName = " 2"
Field Value
| Type | Description |
|---|---|
| System.String |
HatchPatternScale
Hatch Pattern Scale or spacing (pattern fill only)
Declaration
public const string HatchPatternScale = " 41"
Field Value
| Type | Description |
|---|---|
| System.String |
HatchPatternType
Hatch Pattern type 0 = User defined 1 = Predefined 2 = Custom
Declaration
public const string HatchPatternType = " 76"
Field Value
| Type | Description |
|---|---|
| System.String |
HatchStyle
Hatch style: 0 = Hatch “odd parity” area (Normal style) 1 = Hatch outermost area only (Outer style) 2 = Hatch through entire area (Ignore style)
Declaration
public const string HatchStyle = " 75"
Field Value
| Type | Description |
|---|---|
| System.String |
NumberOfBoundaryLoops
Number of boundary paths (loops)
Declaration
public const string NumberOfBoundaryLoops = " 91"
Field Value
| Type | Description |
|---|---|
| System.String |
NumberOfEdgesInBoundary
Number of edges in this boundary path (only if boundary is not a polyline)
Declaration
public const string NumberOfEdgesInBoundary = " 93"
Field Value
| Type | Description |
|---|---|
| System.String |
NumberOfPatternDefLines
Number of Pattern Definition Lines
Declaration
public const string NumberOfPatternDefLines = " 78"
Field Value
| Type | Description |
|---|---|
| System.String |
SolidFillFlag
Solid fill flag (0 = pattern fill; 1 = solid fill); for MPolygon, the version of MPolygon
Declaration
public const string SolidFillFlag = " 70"
Field Value
| Type | Description |
|---|---|
| System.String |
SourceObjectsCount
Number of source objects, SoftPointer
Declaration
public const string SourceObjectsCount = " 97"
Field Value
| Type | Description |
|---|---|
| System.String |
StartMarker
The Start Marker of the Hatch Entity
Declaration
public const string StartMarker = "HATCH"
Field Value
| Type | Description |
|---|---|
| System.String |


update 07/14/2021 - add in vocabulary transcription factors
library(pheatmap)
library(tidyverse)
library(RColorBrewer)
library(viridis)
library(reshape2)
library(caret)
library( org.Hs.eg.db )
library(AnnotationDbi)
library(Biobase)
library(limma)
library(tximport)
library(stringr)
library(Rtsne)
library(caret)
library(clusterProfiler)
library(pheatmap)
library(ReactomePA)
library(annotate)
library(seqinr)
# library(qlcMatrix)
save_pheatmap_png <- function(x, filename, width=1200, height=1000, res = 200) {
png(filename, width = width, height = height, res = res)
grid::grid.newpage()
grid::grid.draw(x$gtable)
dev.off()
}
save_pheatmap_pdf <- function(x, filename, width=7, height=7) {
stopifnot(!missing(x))
stopifnot(!missing(filename))
pdf(filename, width=width, height=height)
grid::grid.newpage()
grid::grid.draw(x$gtable)
dev.off()
}
annon_df = read.csv('../data/external/HOCOMOCOv11_annotation.csv',row.names=1)
head(annon_df)
save_prefix = '../data/processed/fig3_footprinting/'
rna_files = as.array(list.files('../data/raw/rna/', pattern=('*/*.genes.results'),recursive=TRUE))
# data.frame(file_path = rna_files)
tissues = as.array(lapply(rna_files, function(x) strsplit(x, '/')[[1]][1]))
sample = as.array(lapply(rna_files, function(x) strsplit(x, '/')[[1]][2]))
sample = as.array(lapply(sample, function(x) strsplit(x, '.genes.results')[[1]][1]))
full_path = as.array(lapply(rna_files, function(x) paste0('../data/raw/rna/',x)))
rna_genes_result = data.frame("tissues" = tissues,"sample"=sample,"full_path"=full_path )
rownames(rna_genes_result) = rna_genes_result$sample
head(rna_genes_result )
# files <- file.path(full_path)
# names(files) <- rna_genes_result$sample
# txi.rsem <- tximport(files, type = "rsem", txIn = FALSE, txOut = FALSE)
### ERROR Need to make all rownames the same...
createSig <- function (data, metadata, col_sel,tissue=TRUE, logFC_thres=.1, p_thres=0.05,max_return = 500) {
# Differential expression analysis with limmma
# This function takes in a target
# Output is a result table of differential expression analysis for target vs control
# load data and preprocess
# metadata_sel <- labels_df %>%
# filter(control==control_id)%>%
# filter(label == target | label == "control")%>%
# dplyr::select(-control)
# rownames(metadata_sel) = metadata_sel$sample
# data <- counts_all_filt[ ,rownames(metadata_sel) ]
# log_data <- log2(data+1)
# metadata = data.frame("column" =cols_all)
if (tissue){
metadata = metadata %>%
mutate(label = if_else(tissues==col_sel, 'target', 'control'))
}
else{
metadata = metadata %>%
mutate(label = if_else(group==col_sel, 'target', 'control'))
}
# set up the design
labels <- factor(metadata$label)
design <- model.matrix(~ labels + 1)
colnames(design) <- levels(labels)
rownames(design) <- metadata$tissue
# proceed with analysis
fit <- lmFit(data, design)
fit <- eBayes(fit, trend=TRUE)
tT = topTable(fit, coef=ncol(design),adjust="fdr", sort.by="p", number=Inf)
tT$gene = rownames(tT)
tT = na.omit(tT)
tT_filt = tT[tT$logFC>logFC_thres & tT$adj.P.Val<p_thres,]
tT_filt = tT_filt%>% arrange(desc(logFC))
# print(dim(tT_filt))
tT_filt = tT_filt[1:min(max_return, dim(tT_filt)[1]),]
return(tT_filt)
}
rna_tpm_file_tissue = '../data/interim/rna/tissue_tpm_sym.csv'
rna_df_tissue = read.csv(rna_tpm_file_tissue, row.names=1,stringsAsFactors=F,check.names = FALSE)
rna_df_tissue_log = log2(rna_df_tissue+1e-2)
rna_df_tissue_norm = as.data.frame(scale(rna_df_tissue_log, center = TRUE, scale = TRUE))
rna_tpm_file = '../data/interim/rna/sample_tpm_sym.csv'
rna_df = read.csv(rna_tpm_file, row.names=1,stringsAsFactors=F,check.names = FALSE)
rna_df_log = log2(rna_df+1e-2)
rna_df_norm = as.data.frame(scale(rna_df_log, center = TRUE, scale = TRUE))
head(rna_df_norm)
par (bg='white')
plot(density(rna_df_norm$"Airway-B1"))
# # rna_df_essential_long = gather(rna_df_norm,"tissue", "log_TPM")
# ggplot(gather(as.data.frame(rna_df_norm),"tissue", "log_TPM"), aes(x=log_TPM,color=tissue))+geom_density()
normal_tissues = c('Airway','Astrocytes','Bladder','Colon','Esophageal',
# 'GDSD0',
# 'GDSD3',
'GDSD6',
'GM12878',
'HMEC',
'Melanocytes',
'Ovarian',
'Pancreas',
'Prostate',
'Renal',
'Thyroid',
'Uterine')
rna_df_tissue_tf_normal = rna_df_tissue[as.character(annon_df$tf),normal_tissues]
rna_df_tissue_tf_normal_bin = rna_df_tissue_tf_normal
rna_df_tissue_tf_normal_bin[rna_df_tissue_tf_normal<=5]<-0
rna_df_tissue_tf_normal_bin[rna_df_tissue_tf_normal>5]<-1
TF_unique_tissue = rownames(rna_df_tissue_tf_normal_bin)[rowSums(rna_df_tissue_tf_normal_bin)==1]
TF_unique_tissue = na.omit(TF_unique_tissue)
length(TF_unique_tissue)
pheatmap(log10(rna_df_tissue_tf_normal[TF_unique_tissue,normal_tissues]+1))
rna_df_tissue[TF_unique_tissue,normal_tissues]
rna_genes_result_normal = rna_genes_result[rna_genes_result$tissues %in% normal_tissues,]
normal_samples = as.array(rna_genes_result_normal$sample)
rna_genes_result_normal$group = c("purple","purple","blue","blue","purple","purple","green","green","green","green",
"purple","purple",
"grey","grey","purple","purple","blue","blue",
"green","green","green","green","purple","purple",
"green","green","green","green","purple","purple")
rna_genes_result_normal
rna_normal_tf = rna_df_log[as.character(annon_df$tf),colnames(rna_df_log) %in% normal_samples]
# rna_normal = rna_df_norm[,colnames(rna_df_norm) %in% normal_samples]
dim(rna_normal_tf)
rna_normal_tf = na.omit(rna_normal_tf)
dim(rna_normal_tf)
#### per tissue
# sig_genes_list = list()
# sig_genes_combined = c()
# for (t in normal_tissues){
# tT_filt = createSig(rna_normal_tf, rna_genes_result_normal, col_sel=t,tissue=TRUE,logFC_thres=.1, p_thres=0.05,max_return = 10)
# print(t)
# print('**')
# print(dim(tT_filt))
# sig_genes_list[[t]] = tT_filt$gene
# sig_genes_combined = c(sig_genes_combined,tT_filt$gene)
# }
#### per group
sig_genes_list = list()
sig_genes_combined = c()
for (group in c("grey","blue","green","purple")){
tT_filt = createSig(rna_normal_tf, rna_genes_result_normal, col_sel=group,tissue=FALSE,max_return = 70)
print(group)
print(dim(tT_filt))
sig_genes_list[[group]] = tT_filt$gene
sig_genes_combined = c(sig_genes_combined,tT_filt$gene)
}
length(sig_genes_combined)
add in vocab tfs
normal_vocab = read.csv('../data/processed/fig7_vocab_go/normal_vocab_df.csv',stringsAsFactor=F)
unique(normal_vocab$tissue)
length(unique(c(normal_vocab$vocab1,normal_vocab$vocab2)))
str(normal_vocab)
add_vocabs = function(tissue, group, sig_genes_list, df=normal_vocab){
print(tissue)
sel_df = df[df$tissue==tissue,]
print(dim(sel_df))
sel_vocabs= unique(c(sel_df$vocab1, sel_df$vocab2))
print(length(sel_vocabs))
print(length(sig_genes_list[[group]]))
sig_genes_list[[group]] = unique(c(sig_genes_list[[group]], sel_vocabs))
print(length(sig_genes_list[[group]]))
return(sig_genes_list)
}
# add tissue specific vocabs
sig_genes_list = add_vocabs('Colon','green', sig_genes_list)
sig_genes_list = add_vocabs('GDSD6','purple',sig_genes_list)
sig_genes_list = add_vocabs('GM12878','blue',sig_genes_list)
sig_genes_list = add_vocabs('Melanocytes','grey',sig_genes_list)
sig_genes_combined = c()
for (group in c("grey","blue","green","purple")){
print(group)
print(length(sig_genes_list[[group]]))
sig_genes_combined = c(sig_genes_combined,sig_genes_list[[group]])
}
length(sig_genes_combined)
# sig_genes_combined = unique(sort(sig_genes_combined))
sig_genes_combined = unique(sig_genes_combined)
length(sig_genes_combined)
normal_tissue_order = c('GM12878',
'Astrocytes', 'Melanocytes',
'Colon', 'Esophageal','Ovarian', 'Pancreas','Renal','Thyroid',
'Airway','Bladder','GDSD6','HMEC','Prostate','Uterine')
annon_df = rna_genes_result_normal%>%
dplyr::select( tissues, group)%>%
unique()
rownames(annon_df) = annon_df$tissues
annon_df = dplyr::select(annon_df, group)
annon_df
# write.csv(annon_df, '../data/processed/fig1/annon_df.csv')
rna_df_tissue_norm_sig = rna_df_tissue_norm[sig_genes_combined,normal_tissue_order]
rna_df_tissue_norm_sig = na.omit(rna_df_tissue_norm_sig)
# rna_df_tissue_norm_sig = rna_df_tissue_norm[sig_genes_sel,normal_tissue_order]
dim(rna_df_tissue_norm_sig)
rna_df_tissue_norm_sig[rna_df_tissue_norm_sig>2] = 2
rna_df_tissue_norm_sig[rna_df_tissue_norm_sig< -2] = -2
# rna_df_tissue_norm_sig = rna_df_tissue_norm_sig[apply(rna_df_tissue_norm_sig,1,max)>0 ,]
# rna_df_tissue_norm_sig = rna_df_tissue_norm_sig[apply(rna_df_tissue_norm_sig,1,sum)< 14,]
# rna_df_tissue_norm_sig = rna_df_tissue_norm_sig[apply(rna_df_tissue_norm_sig,1,sd)>0.2 ,]
select_genes = rownames(rna_df_tissue_norm_sig)
dim(rna_df_tissue_norm_sig)
# p_with_genes = pheatmap(rna_df_tissue_norm_sig,
# cluster_rows=T,
# cluster_cols=T,
# # fontsize=4,
# # annotation_col=annon_df,
# color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
# # save_pheatmap_png(p_with_genes, paste0(save_prefix, 'rna_heatmap.png'), width=1200, height=40000, res = 200)
p_with_genes = pheatmap(rna_df_tissue_norm_sig,
cluster_rows=T,
cluster_cols=T,
scale_col=T,
# fontsize=4,
annotation_col=annon_df,
color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
save_pheatmap_pdf(p_with_genes, paste0(save_prefix, 'rna_tf_heatmap_by_group.pdf'), width=10, height=40)
tf_ordering = rownames(rna_df_tissue_norm_sig)[p_with_genes$tree_row[["order"]]]
p_no_genes = pheatmap(rna_df_tissue_norm_sig,
cluster_rows=F,
cluster_cols=F,
show_rownames=F,
annotation_col=annon_df,
color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
# save_pheatmap_png(p_no_genes, paste0(save_prefix, 'rna_heatmap_no_genes.png'), width=3000, height=3000, res = 500)
sort(tf_ordering)
'KLF5' %in% select_genes
purple_TFs= sig_genes_list$purple[ sig_genes_list$purple %in% select_genes]
length(purple_TFs)
green_TFs = sig_genes_list$green[ sig_genes_list$green %in% select_genes]
length(green_TFs)
blue_TFs = sig_genes_list$blue[ sig_genes_list$blue %in% select_genes]
length(blue_TFs)
grey_TFs = sig_genes_list$grey[ sig_genes_list$grey %in% select_genes]
length(grey_TFs)
all_genes = rownames(rna_df_tissue_norm)
length(all_genes)
previously before adding vocabs
tf_group_df = rbind(data.frame(tf=purple_TFs,group='purple'),
data.frame(tf=green_TFs,group='green'),
data.frame(tf=grey_TFs,group='grey'),
data.frame(tf=blue_TFs,group='blue'))
tf_group_df = tf_group_df %>%
group_by(tf)%>%
mutate(group_str = paste0(group, collapse = "|")) %>%
ungroup()%>%
dplyr::select(-group)%>%
distinct()%>%
arrange(tf)%>%
column_to_rownames("tf")
str(tf_group_df)
tf_group_df%>%group_by(group_str)%>%tally()
head(tf_group_df,41)
# tissue = 'GDSD6'
# group = annon_df[tissue,]
# write.table(sort(purple_TFs), file = paste0(save_prefix, "purple_TFs.csv"),row.names=FALSE,col.names=FALSE)
# write.table(sort(green_TFs), file = paste0(save_prefix, "green_TFs.csv"),row.names=FALSE,col.names=FALSE)
# write.table(sort(blue_TFs), file = paste0(save_prefix, "blue_TFs.csv"),row.names=FALSE,col.names=FALSE)
# write.table(sort(grey_TFs), file = paste0(save_prefix, "grey_TFs.csv"),row.names=FALSE,col.names=FALSE)
# write.table(sort(select_genes), file = paste0(save_prefix, "select_TFs.csv"),row.names=FALSE,col.names=FALSE)
# write.table(sort(all_genes), file = paste0(save_prefix, "all_genes.csv"),row.names=FALSE,col.names=FALSE)
all_entrez = bitr(all_genes, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")$ENTREZID
# deprecated
##RUN ONCE ###
# overall_df = data.frame()
# # for (tissue in normal_tissues){
# # print(tissue)
# # tissue_crm_file = paste0('../data/processed/tissue_crms/combined_tissue/',tissue,'_crm.csv')
# # tissue_crm_df = read.csv(tissue_crm_file,row.names=1)
# # group = annon_df[tissue,]
# # tfs_in_group = sort(rownames(tf_group_df)[tf_group_df==group])
# # for (tf in tfs_in_group){
# if (tf %in% colnames(tissue_crm_df)){
# print(tf)
# target_genes = rownames(tissue_crm_df)[tissue_crm_df[,tf]>0]
# target_genes_entrez = bitr(target_genes, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")$ENTREZID
# print(length(target_genes_entrez))
# er = enrichPathway(
# gene = target_genes_entrez, organism = "human", pvalueCutoff = 0.05, pAdjustMethod = "none", qvalueCutoff = 0.5,
# universe = all_entrez,
# readable = TRUE
# )
# er_df = data.frame(er)
# if (dim(er_df)[1] >0){
# er_df$tf = tf
# er_df$tissue = tissue
# er_df$num_target_genes = length(target_genes_entrez)
# rownames(er_df) = NULL
# overall_df = rbind(overall_df, er_df)
# }
# }
# }
# }
# write.csv(overall_df,paste0(save_prefix, 'tf_tissue_tg.csv'))
##RUN ONCE ###
# takes a lot of hours
overall_df_go = data.frame()
for (tissue in normal_tissues){
print(tissue)
tissue_crm_file = paste0('../data/processed/tissue_crms/combined_tissue/',tissue,'_crm.csv')
tissue_crm_df = read.csv(tissue_crm_file,row.names=1)
group = annon_df[tissue,]
tfs_in_group = sort(rownames(tf_group_df)[tf_group_df==group])
for (tf in tfs_in_group){
if (tf %in% colnames(tissue_crm_df)){
print(tf)
target_genes = rownames(tissue_crm_df)[tissue_crm_df[,tf]>0]
target_genes_entrez = bitr(target_genes, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")$ENTREZID
print(length(target_genes_entrez))
ego <- enrichGO(gene = target_genes_entrez,
universe = all_entrez,
OrgDb = org.Hs.eg.db,
ont = "BP",
pAdjustMethod = "BH",
pvalueCutoff = 0.3,
qvalueCutoff = 0.2)
er_df = data.frame(ego)
print(dim(er_df)[1])
if (dim(er_df)[1] >0){
er_df$tf = tf
er_df$tissue = tissue
er_df$num_target_genes = length(target_genes_entrez)
rownames(er_df) = NULL
overall_df_go = rbind(overall_df_go, er_df)
}
}
}
}
write.csv(overall_df_go,paste0(save_prefix, 'tf_tissue_tg_go_edit071421.csv'))
tissue_colors = read.csv(paste0(save_prefix, 'tissue_colors.csv'))
tissue_colors = filter(tissue_colors, (tissue!='GDSD0')&(tissue!='GDSD3'))
save_prefix
# overall_df_go = read.csv('../data/processed/old_figs_051820/fig3_footprinting/tf_tissue_tg_go_2.csv',row.names=1,stringsAsFactors=F)#,stringAsFactors=F)
overall_df_go = read.csv('../data/processed/old_figs_051820/fig3_footprinting/tf_tissue_tg_go_edit071421.csv',row.names=1,stringsAsFactors=F)#,stringAsFactors=F)
overall_df_go$tissue = as.character(overall_df_go$tissue)
overall_df_go = overall_df_go%>%
filter((tissue!='GDSD0')&(tissue!='GDSD3'))
tf_df = overall_df_go%>% group_by(tf)%>%summarize(n())%>%arrange(tf)
overall_df_go%>% group_by(tissue)%>%summarize(n())
colnames(overall_df_go)
descriptions = overall_df_go%>% dplyr::select(Description) %>% unique()%>% arrange(Description)
write.csv(descriptions, paste0(save_prefix,'go_descriptions_edit071421.csv'))#group_by(tf)%>%summarize(n())
overall_df_go%>%
filter(p.adjust < 0.05)%>%
dplyr::select(tf)%>%
distinct()%>%
dim()
# num of descriptions that are significant
length(unique(overall_df_go[overall_df_go[["p.adjust"]] < 0.05,]$Description))
descriptions_picked = read.csv('../data/processed/fig3_footprinting/select_go_descriptions.csv',
header=F,stringsAsFactor=F)$V1
length(descriptions_picked)
overall_df_go_filt = overall_df_go[overall_df_go$Description %in% descriptions_picked,]
dim(overall_df_go_filt)
length(unique(overall_df_go_filt$Description))
tfs_picked = sort(unique(overall_df_go_filt$tf))
length(tfs_picked)
using to be 106 - know 144
groups_df = rna_genes_result_normal%>% dplyr::select(tissues,group)%>%unique()
groups_df$tissues = as.character(groups_df$tissues)
rownames(groups_df) = NULL
groups_df[groups_df$group=='purple',] #checking
select_group = function(df,group_str){
df_group = df%>%
left_join(groups_df, by=c('tissue'='tissues'))%>%
filter(group==group_str)%>%
mutate(pvalue = pmin(1,pvalue*dim(groups_df[groups_df$group==group_str,])[1]))%>%
# filter(pvalue<.05)%>%
dplyr::select('Description','tissue','pvalue','tf')%>%
group_by(tf,Description)%>%
summarise(pval = min(pvalue), n= n())%>%
mutate(pval_correct = pmin(1, pval*n))%>%
# filter(pval_correct<0.05)%>%
mutate(group = group_str)
}
overall_df_go_purple = select_group(overall_df_go_filt, 'purple')
dim(overall_df_go_purple)
overall_df_go_grey = select_group(overall_df_go_filt, 'grey')
dim(overall_df_go_grey)
overall_df_go_green = select_group(overall_df_go_filt, 'green')
dim(overall_df_go_green)
overall_df_go_blue = select_group(overall_df_go_filt, 'blue')
dim(overall_df_go_blue)
overall_df_regrouped_go = rbind(overall_df_go_purple, overall_df_go_grey, overall_df_go_green, overall_df_go_blue)
length(unique(overall_df_regrouped_go$Description))
overall_df_regrouped_go = overall_df_regrouped_go%>%
group_by(tf, Description)%>%
summarise(pval = min(pval_correct), n= n())%>%
mutate(pval_correct = pmin(1, pval*n))%>%
filter(pval_correct<0.10)%>%
arrange(pval_correct)%>%
mutate(log10_pval = -log10(pval_correct))
overall_df_regrouped_go$Description = as.character(overall_df_regrouped_go$Description)
length(unique(overall_df_regrouped_go$Description))
descriptions_picked[!(descriptions_picked%in%unique(overall_df_regrouped_go$Description))]
description_order = descriptions_picked[(descriptions_picked%in%unique(overall_df_regrouped_go$Description))]
length(description_order)
summary(overall_df_regrouped_go)
length(unique(overall_df_regrouped_go$tf))
from 96 to 121
# stat_descr_count = overall_df_regrouped_go%>%
# group_by(Description)%>%
# summarize(count=n())%>%
# mutate(name = if_else(count>1, Description, ''))%>%
# column_to_rownames( 'Description')%>%
# dplyr::select(-count)
# descr_plus_2 = overall_df_regrouped_go%>%
# group_by(Description)%>%
# summarize(count=n())%>%
# filter(count>1)
# descr_plus_2= descr_plus_2$Description
# overall_df_regrouped_go
# overall_df_regrouped_go_spread = overall_df_regrouped_go%>%
# dplyr::select('Description','pval_correct','tf')%>%
# spread('Description', 'pval_correct', fill = 1, convert = FALSE)
# rownames(overall_df_regrouped_spread) = overall_df_regrouped_spread$tf
# overall_df_regrouped_go_spread = column_to_rownames(overall_df_regrouped_go_spread,"tf")
# # get ordering of tfs that matches above heatmap
# select_tfs_post_enrich_go = tf_ordering[tf_ordering %in% rownames(overall_df_regrouped_go_spread)]
# length(select_tfs_post_enrich_go)
# overall_df_regrouped_go_spread = overall_df_regrouped_go_spread[select_tfs_post_enrich_go,]
# dim(overall_df_regrouped_go_spread)
# if (length(nearZeroVar(overall_df_regrouped_go_spread)) > 0) {
# overall_df_regrouped_go_spread_highVar <- overall_df_regrouped_go_spread[, -nearZeroVar(overall_df_regrouped_go_spread)]
# }
# rownames(overall_df_regrouped_go_spread_highVar) = select_tfs_post_enrich_go
# dim(overall_df_regrouped_go_spread_highVar)
# colnames(overall_df_regrouped_go_spread_highVar)
# overall_df_regrouped_go_spread_select_col = overall_df_regrouped_go_spread[,]
# dim(overall_df_regrouped_go_spread_select_col)
# select_tfs_post_go_term = rownames(overall_df_regrouped_go_spread)
select_tfs_post_go_term =unique(overall_df_regrouped_go$tf)# tf_df$tf
length(select_tfs_post_go_term)
rna_df_tissue_tf_normal = rna_df_tissue[select_tfs_post_go_term,normal_tissue_order]
rna_df_tissue_tf_normal_log = log2(rna_df_tissue_tf_normal+1e-2)
rna_df_tissue_tf_normal_log_norm = as.data.frame(scale(rna_df_tissue_tf_normal_log, center = TRUE, scale = TRUE))
rna_df_tissue_tf_normal_log_norm[rna_df_tissue_tf_normal_log_norm< (-2)] = -2
rna_df_tissue_tf_normal_log_norm[rna_df_tissue_tf_normal_log_norm> (2)] = 2
# rna_df_tissue_tf_normal_log_norm = rna_df_tissue_tf_normal_log_norm[apply(rna_df_tissue_tf_normal_log_norm,1,max)>0 ,]
# rna_df_tissue_tf_normal_log_norm = rna_df_tissue_tf_normal_log_norm[apply(rna_df_tissue_tf_normal_log_norm,1,sum)< 14,]
# rna_df_tissue_tf_normal_log_norm = rna_df_tissue_tf_normal_log_norm[apply(rna_df_tissue_tf_normal_log_norm,1,sd)>0.2 ,]
p_with_genes = pheatmap(rna_df_tissue_tf_normal_log_norm,
cluster_rows=T,
cluster_cols=F,
scale_row=T,
scale_col=T,
# fontsize=4,
annotation_col=annon_df,
color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
tf_ordering = rownames(rna_df_tissue_tf_normal_log_norm)[p_with_genes$tree_row[["order"]]]
length(tf_ordering)
overall_df_regrouped_go_spread = overall_df_regrouped_go%>%
dplyr::select('Description','pval_correct','tf')%>%
spread('Description', 'pval_correct', fill = 1, convert = FALSE)
overall_df_regrouped_go_spread = column_to_rownames(overall_df_regrouped_go_spread,"tf")
overall_df_regrouped_go_spread = overall_df_regrouped_go_spread[tf_ordering,]
# overall_df_regrouped_go_spread_highVar = overall_df_regrouped_go_spread_highVar[tf_ordering,]
overall_df_regrouped_go = rbind(overall_df_go_purple, overall_df_go_grey, overall_df_go_green, overall_df_go_blue)
overall_df_regrouped_go = overall_df_regrouped_go%>%
# group_by(tf, Description)%>%
# summarise(pval = min(pval_correct), n= n())%>%
# mutate(pval_correct = pmin(1, pval*n))%>%
# filter(pval_correct<0.05)%>%
# arrange(pval_correct)%>%
mutate(log10_pval = -log10(pval_correct))
overall_df_regrouped_go$Description = as.character(overall_df_regrouped_go$Description)
overall_df_regrouped_go_reduced = overall_df_regrouped_go %>%
group_by(tf, Description) %>%
filter(log10_pval == min(log10_pval)) %>%
filter(1:n() == 1)
overall_df_regrouped_go_spread = overall_df_regrouped_go_reduced%>%
dplyr::select('Description','log10_pval','tf')%>%
spread('Description', 'log10_pval', fill = 0, convert = FALSE)
# rownames(overall_df_regrouped_spread) = overall_df_regrouped_spread$tf
overall_df_regrouped_go_spread = column_to_rownames(overall_df_regrouped_go_spread,"tf")
p_go = pheatmap(overall_df_regrouped_go_spread[tf_ordering,],
cluster_rows=F,
annotation_row=tf_group_df)
save_pheatmap_pdf(p_go, paste0(save_prefix, 'overall_df_regrouped_go_spread.pdf'), width=20, height=20)
description_order
length(colnames(overall_df_regrouped_go_spread))
go_term_ordering = description_order[description_order%in% colnames(overall_df_regrouped_go_spread)[p_go$tree_col[["order"]]]]
go_term_ordering
# # write.csv(go_term_ordering_sel,paste0(save_prefix,'go_term_ordering_sel.csv'))
# go_term_ordering_sel= as.character(read.csv(paste0(save_prefix,'go_term_ordering_sel.csv'))$x)
# go_term_ordering_sel
p_go_sel = pheatmap(overall_df_regrouped_go_spread[tf_ordering,go_term_ordering],
cluster_rows=F,cluster_cols=F,
annotation_row=tf_group_df)
save_pheatmap_pdf(p_go_sel, paste0(save_prefix, 'overall_df_regrouped_go_spread_sel.pdf'), width=10, height=20)
dim(overall_df_regrouped_go_spread[tf_ordering,go_term_ordering])
overall_df_go_filt_with_groups = overall_df_go_filt%>%
left_join(groups_df, by=c('tissue'='tissues'))%>%
left_join(tissue_colors, by='tissue')%>%
mutate(log10_pval=-log10(p.adjust))%>%
filter(Description %in% go_term_ordering)%>%
filter(tf %in% tf_ordering)
dim(overall_df_go_filt_with_groups)
# overall_df_go_filt_with_groups
tissue_order = as.character(tissue_colors$tissue)
color_order = as.character(tissue_colors$color)
write.csv(overall_df_go_filt_with_groups, paste0(save_prefix,'overall_df_go_filt_with_groups.csv'))
see if it it the case where each tissue is using their own suite of TFs to carry out important functions within that tissue
overall_df_go_filt_with_groups = read.csv(paste0(save_prefix,'overall_df_go_filt_with_groups_filt.csv'),stringsAsFactor=F)
dim(overall_df_go_filt_with_groups)
# new order =
go_term_ordering = c('lymphocyte costimulation',
'tumor necrosis factor-mediated signaling pathway',
'negative regulation of neuron apoptotic process',
'regulation of neuron apoptotic process',
'pigment biosynthetic process',
'pigment metabolic process',
'epithelial tube morphogenesis',
'epithelial tube formation',
'regulation of epithelial cell differentiation',
'epithelial cell development',
'development of primary female sexual characteristics',
'germ cell development',
'female gamete generation',
'keratinocyte development',
'epidermal cell differentiation',
'epidermis development',
'epithelial cell proliferation involved in prostate gland development',
'male gonad development')
dim(overall_df_go_filt_with_groups)
overall_df_go_filt_with_groups = overall_df_go_filt_with_groups[overall_df_go_filt_with_groups$Description %in% go_term_ordering,]
dim(overall_df_go_filt_with_groups)
length(unique(overall_df_go_filt_with_groups$tf))
length(tf_ordering)# originally 96
tf_ordering = tf_ordering[tf_ordering%in%unique(overall_df_go_filt_with_groups$tf)]
length(tf_ordering)
previously 75 tfs
dim(rna_df_tissue_tf_normal_log_norm[tf_ordering,])
p_with_genes = pheatmap(rna_df_tissue_tf_normal_log_norm[tf_ordering,],
cluster_rows=F,
cluster_cols=F,
scale_row=T,
scale_col=T,
# fontsize=4,
annotation_col=annon_df,
color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
save_pheatmap_pdf(p_with_genes, paste0(save_prefix, 'rna_tf_heatmap_by_group_post_goterm.pdf'), width=5.5, height=17)
length(tf_ordering)
length(go_term_ordering)
p_dot_tissue = ggplot(overall_df_go_filt_with_groups, aes(x=factor(Description,level=go_term_ordering), y = factor(tf,level=rev(tf_ordering)),
color=factor(tissue, level=tissue_order)))+
geom_point(aes(size=log10_pval))+
scale_color_manual(values=color_order)+
theme_minimal()+
theme(axis.text.x = element_text(angle = 90,vjust=0.5,hjust=1))
p_dot_tissue
ggsave(file = paste0(save_prefix, "overall_df_regrouped_go_reduced_bytissue.eps"),height=17, width=8)
# # level_order <- c('virginica', 'versicolor', 'setosa') #this vector might be useful for other plots/analyses
# ggplot(overall_df_regrouped_go, aes(x = factor(Description, y = tf)) +
# geom_point(aes( size=log10_pval)) +#,colour="black",pch=21)
# theme(axis.text.x = element_text(angle = 45))
# # scale_size_area(max_size = 10)
# check to make sure all tfs are preserved
overall_df_regrouped_go_reduced = overall_df_regrouped_go_reduced%>%
filter(Description %in% go_term_ordering)%>%
filter(tf %in% tf_ordering)
overall_df_regrouped_go_reduced%>%
group_by(tf)%>%
summarise(n())%>%dim()
p_dot = ggplot(overall_df_regrouped_go_reduced, aes(x=factor(Description,level=go_term_ordering), y = factor(tf,level=tf_ordering),
color=group))+
geom_point(aes(size=log10_pval))+
scale_color_manual(values=c("blue", "lightgreen", "grey","purple"))+
theme(axis.text.x = element_text(angle = 45,hjust=1))
p_dot
ggsave(file = paste0(save_prefix, "overall_df_regrouped_go_reduced.eps"),height=20, width=15)
# # level_order <- c('virginica', 'versicolor', 'setosa') #this vector might be useful for other plots/analyses
# ggplot(overall_df_regrouped_go, aes(x = factor(Description, y = tf)) +
# geom_point(aes( size=log10_pval)) +#,colour="black",pch=21)
# theme(axis.text.x = element_text(angle = 45))
# # scale_size_area(max_size = 10)
dim(-log10(overall_df_regrouped_go_spread[,descr_plus_2]))
p_go_highvar = pheatmap(-log10(overall_df_regrouped_go_spread_highVar),
cluster_rows=T,
annotation_row=tf_group_df)
save_pheatmap_pdf(p_go_highvar, paste0(save_prefix, 'overall_df_regrouped_go_spread_highVar.pdf'), width=15, height=15)
p_go_highvar = pheatmap(-log10(overall_df_regrouped_go_spread_highVar),
cluster_rows=T,
annotation_row=tf_group_df)
save_pheatmap_pdf(p_go_highvar, paste0(save_prefix, 'overall_df_regrouped_go_spread_highVar.pdf'), width=15, height=15)
p_with_genes_after_go = pheatmap(rna_df_tissue_norm_sig[[,
cluster_rows=T,
cluster_cols=T,
scale_col=T,
# fontsize=4,
annotation_col=annon_df,
color = colorRampPalette(rev(brewer.pal(n =8, name ="RdBu")))(255))
save_pheatmap_png(p_with_genes, paste0(save_prefix, 'rna_tf_heatmap_by_group.png'), width=1200, height=4000, res = 200)
# overall_df = read.csv(paste0(save_prefix, 'tf_tissue_tg.csv'),row.names=1)
# head(overall_df)
# dim(overall_df)
# overall_df$tissue = as.character(overall_df$tissue)
# overall_df_purple = select_group(overall_df, 'purple')
# dim(overall_df_purple)
# overall_df_grey = select_group(overall_df, 'grey')
# dim(overall_df_grey)
# overall_df_green = select_group(overall_df, 'green')
# dim(overall_df_green)
# overall_df_blue = select_group(overall_df, 'blue')
# dim(overall_df_blue)
# overall_df_regrouped = rbind(overall_df_purple, overall_df_grey, overall_df_green, overall_df_blue)
# overall_df_regrouped = overall_df_regrouped%>%
# group_by(tf, Description)%>%
# summarise(pval = min(pval_correct), n= n())%>%
# mutate(pval_correct = pmin(1, pval*n))%>%
# filter(pval_correct<0.05)%>%
# arrange(pval_correct)
# overall_df_purple[overall_df_purple$tf %in% purple_TFs,]%>%arrange(pval_correct)%>%head(10)
# overall_df_purple%>%arrange(pval_correct)%>%head(10)
# overall_df_regrouped_spread = overall_df_regrouped%>%
# dplyr::select('Description','pval_correct','tf')%>%
# spread('Description', 'pval_correct', fill = 1, convert = FALSE)
# # rownames(overall_df_regrouped_spread) = overall_df_regrouped_spread$tf
# overall_df_regrouped_spread = column_to_rownames(overall_df_regrouped_spread,"tf")
# # get ordering of tfs that matches above heatmap
# select_tfs_post_enrich = tf_ordering[tf_ordering %in% rownames(overall_df_regrouped_spread)]
# length(select_tfs_post_enrich)
# overall_df_regrouped_spread = overall_df_regrouped_spread[select_tfs_post_enrich,]
# dim(overall_df_regrouped_spread)
# if (length(nearZeroVar(overall_df_regrouped_spread)) > 0) {
# overall_df_regrouped_spread_highVar <- overall_df_regrouped_spread[, -nearZeroVar(overall_df_regrouped_spread)]
# }
# rownames(overall_df_regrouped_spread_highVar) = select_tfs_post_enrich
# dim(overall_df_regrouped_spread_highVar)
# p_reactome = pheatmap(-log10(overall_df_regrouped_spread),
# cluster_rows=T,
# annotation_row=tf_group_df)
# save_pheatmap_pdf(p_reactome, paste0(save_prefix, 'overall_df_regrouped_spread.pdf'), width=100, height=20)
# colnames(overall_df_regrouped_spread)
# p_reactome_highvar = pheatmap(-log10(overall_df_regrouped_spread_highVar),
# cluster_rows=T,
# annotation_row=tf_group_df)
# save_pheatmap_pdf(p_reactome_highvar, paste0(save_prefix, 'overall_df_regrouped_spread_highVar.pdf'), width=30, height=20)
# select_tfs_post_enrich = select_genes[select_genes %in% rownames(tf_by_reactome_pval_mean)]
# if (length(nearZeroVar(tf_by_reactome_pval_mean)) > 0) {
# tf_by_reactome_pval_mean_highVarCol <- tf_by_reactome_pval_mean[select_tfs_post_enrich, -nearZeroVar(tf_by_reactome_pval_mean)]
# }
# rownames(tf_by_reactome_pval_mean_highVarCol) = select_tfs_post_enrich
# dim(tf_by_reactome_pval_mean_highVarCol)
# p_reactome = pheatmap(-log2(tf_by_reactome_pval_mean_highVarCol),
# cluster_rows=F)
# save_pheatmap_pdf(p_reactome, paste0(save_prefix, 'tf_by_reactome_pval_mean_highVarCol.pdf'), width=50, height=20)
# tf_by_reactome_pval_mean[select_tfs_post_enrich,]
# tissue = 'GDSD6'
# tissue_crm_file = paste0('../data/processed/tissue_crms/combined_tissue/',tissue,'_crm.csv')
# tissue_crm_df = read.csv(tissue_crm_file,row.names=1)
# head(tissue_crm_df)
# length(select_genes)
# tf = 'TP63'#select_genes[2] #PRDM1
# tf
# tf %in% colnames(tissue_crm_df)
# target_genes = rownames(tissue_crm_df)[tissue_crm_df[,tf]>0]
# write.csv(target_genes,paste0(save_dir, tf,'_',tissue,'_target_genes.csv'))
# target_genes_entrez = bitr(target_genes, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")$ENTREZID
# length(target_genes_entrez)
# ego <- enrichGO(gene = target_genes_entrez,
# universe = all_entrez,
# OrgDb = org.Hs.eg.db,
# ont = "BP",
# pAdjustMethod = "BH",
# pvalueCutoff = 0.05,
# qvalueCutoff = 0.2)#,
# # readable = TRUE)
# dim(ego)
# head(ego)
# er = enrichPathway(
# gene = target_genes_entrez, organism = "human", pvalueCutoff = 0.05, pAdjustMethod = "none", qvalueCutoff = 0.5,
# universe = all_entrez,
# readable = TRUE
# )
# er_df = data.frame(er)
# dim(er_df)
# er_df$tf = tf
# er_df$tissue = tissue
# rownames(er_df) = NULL
# head(er_df)
# dotplot(er)