About DSN flood prediction
A web app to help users prepare for and reallocate resources for floods.
Floods are one of the most dangerous and frequent natural disasters in the world.
Every year, thousands of people die from the floods and millions of people lose their homes and livelihoods. In many states around India and China's Yellow River Valley, some of the world's worst floods have killed thousands, if not millions of people.
Our team wanted to help solve this problem, so we created Flood prediction ML model to predict floods and their impact before they even happen. Then, we display this information in an interactive graphical format, making the information compelling and easy to understand for people.
features
Our website offers many services to help people plan and prepare for floods, and help reallocate resources to those most in need.
View Plots
On this website, you can view plots showing flood prediction, precipitation analysis, and damage analysis.
View Heatmaps
This website also displays interactive heatmaps sharing various realtime data on floods.
Satellite Images
We analyzed data from NASA's GPM Project, and displayed georeferenced plots for sevaral cities.
Predict Floods
Lastly, our website allows you to predict floods in realtime through our machine learning algorithm.
Percent of deaths from natural disasters attributed to floods
Billion people affected by floods in the last 2 decades
Billion dollars in damages worldwide annually
Million people were displaced in India in 2019 alone.
RoadMap
-
Inspiration
Floods are among the most destructive natural disasters, which are highly complex to model. The research on the advancement of flood prediction models contributed to risk reduction, policy suggestions, minimization of the loss of human life, and reduction of the property damage associated with floods. To mimic the complex mathematical expressions of physical processes of floods, the advancement of prediction systems providing better performance and a cost-effective solution.
-
Development
THE DATASET
Our thesis was that we could predict floods from weather data using machine learning. For the dataset, we first scraped this website http://floodlist.com/tag/india using the python beautiful-soup 4 library. This website gave us data about past floods India.- when and where they occurred. We then used the visual crossing weather API to obtain historic weather data such as precipitation, humidity, temperature data, cloud cover etc. in those areas, and during those times. We also performed data augmentation on this, and then stored it in a .csv file.
ML MODEL
Our ML model is based on python sci-kit learn library. We used pandas to generate a data-frame from the .csv file, and then tried various ML models such as Logistic regression, KNN, and Random Forester. Out of these, the Random Forester classifier gave the highest accuracy of 98.71% on the test set. We then saved our model using a .pickle file.
DATA VISUALIZATION
We first obtained a dataset of the major cities and towns in India (around 200 of them) along with their latitude, longitude and population. We then got the weather forecast of each city using the weather API and ran that into our ML model. Next, we plotted the data from the ML model on a map, using plotly chart studio. The various maps represent various data such as flood prediction, precipitation and damage estimates, in the form of scatter plots, heat-maps and bubble plots. The damage estimates were calculated using the flood prediction and population. We also plotted it on satellite images.
FRONT-END AND HOSTING
Our web app is based on the flask python framework. We rendered HTML templates on top of this flask back-end, and styled it using CSS. Our web app is hosted via Heroku.
-
Accomplishments we are proud of
- Creating the best dataset in existence for flood prediction in India.
- Making a highly effective ML model with over 98% accuracy.
- Making a clean-looking UI for the web app.
- Creating sophisticated plots for data visualization.
-
Future plans and Research
Future plans and Research: Similar to flood prediction we can predict the drought. it will help us to manage our natural water resources and use them accordingly. The uncertainty of drought forecasting based on past meteorological data is increasing because of climate change. However, agricultural droughts, associated with food resources and determined by soil moisture, must be predicted several months ahead for timely resource allocation. Artificial cloud: Cloud seeding is a term used for artificial clouds. cloud seeding or weather modification is an artificial way to induce moisture in the clouds so as to cause rainfall. In this process, either silver iodide or dry ice is dumped onto the clouds by using an aircraft or an artillery gun which leads to a rain shower. We planed to extend our project possible to propose an idea regarding this cloud seeding In the future.
-
Project Guidance
Dr. L. Sathish Kumar Assistant Professor in the School of Computing Science and Engineering at VIT Bhopal University, Bhopal, Madhya Pradesh


Commission Calculator
Product Name:
Price:
Quantity:
Commission Rate:
Commission Type:
Percentage
Basis Point
Calculate
Reset
Commission Report
Product
Price
Quantity
Commission Rate
Commission Amount
Delete


Research culture must be kinder for all, not just royalty
by Serena Nik-ZainalAs one who has benefited from Wellcome support and is keen to see a real improvement in working environments for the next generation of academics, I applaud efforts to achieve kinder research cultures (see Nature 574, 5–6; 2019). However, the drive for excellence is not the main problem.
Noxious research environments develop when bad conduct, such as bias, discrimination and controlling behaviour, goes unchecked. Some senior scientists might find that conceding a tendency to ‘overvalue’ excellence is easier than admitting to, say, turning a blind eye to poorly conducted investigations, or closing ranks around prominent scientists.
Researchers who are undermined at work are often reluctant to speak up for fear of rocking the team boat, or of losing out on resources and future references. Moreover, academia’s complaints system is stacked against them (see, for example, S. Nik-Zainal and I. Barroso Nature 565, 429; 2019). Their unhappy silence has nothing to do with excellence, and everything to do with the system’s partiality towards the upper echelons of the research establishment. If there are no ramifications for bad behaviour, toxic cultures will be perpetuated.
The worst possible outcome would be for kindness in research to be applied differentially: biased towards scientific royalty at the top of the power gradient, with no change for the rest of us. That would pose a serious threat to UK scientific excellence.
Nature 575, 287 (2019)
doi: 10.1038/d41586-019-03466-8
Competing Financial Interests
Serena Nik-Zainal is a previous Wellcome Trust Fellow and was a whistleblower on bullying, harassment, discrimination and governance failings at a previous employer.


org.scalatest.matchers.ClassicMatchers
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL.
This method enables the following syntax:
This method enables the following syntax:
Map("one" -> 1, "two" -> 2) should (not contain value (5) and not contain value (3)) ^
This method enables the following syntax:
This method enables the following syntax:
"1.7" should (endWith regex (decimalRegex) and endWith regex (decimalRegex))
^
This method enables the following syntax:
This method enables the following syntax:
"1.78" should (have length (4) and startWith regex ("1.7")) ^
This method enables the following syntax:
This method enables the following syntax:
"hello, world" should (include regex ("hel*o") and include regex ("wor.d")) ^
This method enables the following syntax:
This method enables the following syntax:
"1.7" should (fullyMatch regex (decimalRegex) and fullyMatch regex (decimalRegex))
^
This method enables the following syntax:
This method enables the following syntax:
isFileMock should (be a ('file) and be a ('file)) ^
This method enables the following syntax:
This method enables the following syntax:
Map("one" -> 1, "two" -> 2) should (contain key ("two") and contain key ("one")) ^
This method enables the following syntax:
This method enables the following syntax:
Array(1, 2) should (have size (2) and have size (3 - 1)) ^
Returns a matcher whose apply
method returns a MatchResult
that represents the logical-and of the results of the wrapped and the passed matcher applied to
the same value.
Returns a matcher whose apply
method returns a MatchResult
that represents the logical-and of the results of the wrapped and the passed matcher applied to
the same value.
The reason and
has an upper bound on its type parameter is so that the Matcher
resulting from an invocation of and
will have the correct type parameter. If you call
and
on a Matcher[Orange]
, passing in a Matcher[Valencia]
,
the result will have type Matcher[Valencia]
. This is correct because both a
Matcher[Orange]
and a Matcher[Valencia]
know how to match a
Valencia
(but a Matcher[Valencia]
doesn't know how to
match any old Orange
). If you call
and
on a Matcher[Orange]
, passing in a Matcher[Fruit]
,
the result will have type Matcher[Orange]
. This is also correct because both a
Matcher[Orange]
and a Matcher[Fruit]
know how to match an
Orange
(but a Matcher[Orange]
doesn't know how to
match any old Fruit
).
a matcher that performs the logical-and of this and the passed matcher
This method enables the following syntax:
This method enables the following syntax:
Map("one" -> 1, "two" -> 2) should (not contain value (2) or not contain value (3)) ^
This method enables the following syntax:
This method enables the following syntax:
"1.7b" should (endWith regex ("hello") or endWith regex ("7b")) ^
This method enables the following syntax:
This method enables the following syntax:
"1.7" should (startWith regex ("hello") or startWith regex ("1.7")) ^
This method enables the following syntax:
This method enables the following syntax:
"a1.7b" should (include regex ("1.7") or include regex ("1.7")) ^
This method enables the following syntax:
This method enables the following syntax:
"1.7" should (fullyMatch regex ("hello") or fullyMatch regex (decimal)) ^
This method enables the following syntax:
This method enables the following syntax:
isFileMock should (be a ('file) or be a ('directory)) ^
This method enables the following syntax:
This method enables the following syntax:
Map("one" -> 1, "two" -> 2) should (contain value (7) or contain value (1)) ^
This method enables the following syntax:
This method enables the following syntax:
Array(1, 2) should (have size (2) and have size (3 - 1)) ^
Returns a matcher whose apply
method returns a MatchResult
that represents the logical-or of the results of this and the passed matcher applied to
the same value.
Returns a matcher whose apply
method returns a MatchResult
that represents the logical-or of the results of this and the passed matcher applied to
the same value.
The reason or
has an upper bound on its type parameter is so that the Matcher
resulting from an invocation of or
will have the correct type parameter. If you call
or
on a Matcher[Orange]
, passing in a Matcher[Valencia]
,
the result will have type Matcher[Valencia]
. This is correct because both a
Matcher[Orange]
and a Matcher[Valencia]
know how to match a
Valencia
(but a Matcher[Valencia]
doesn't know how to
match any old Orange
). If you call
or
on a Matcher[Orange]
, passing in a Matcher[Fruit]
,
the result will have type Matcher[Orange]
. This is also correct because both a
Matcher[Orange]
and a Matcher[Fruit]
know how to match an
Orange
(but a Matcher[Orange]
doesn't know how to
match any old Fruit
).
a matcher that performs the logical-or of this and the passed matcher
This class is part of the ScalaTest matchers DSL. Please see the documentation for
ShouldMatchers
orMustMatchers
for an overview of the matchers DSL.


If you are reading this in your own portal, congratulations, it’s working!
If you are reading this locally, start with the README file in the github repository for instructions on how to get the portal up and running first.
Great question.
This is one of the default topics included as sample content in the portal. More than anything it’s designed to give you reassurance that the portal is working. Why not start by replacing it with your own content?
There’s a topic on replacing the default topics with your own content. A link to it is at the bottom of this topic, but instead of looking for that, why not test search?
That search link illustrates something nice about this portal - everything is a bookmarkable link, including searches. Feel free to bookmark them, give them to your users, etc.
Once you’re gotten your own content in the portal, you probably want to change the styling of the portal. Perhaps the header color is just the wrong shade of blue, or you want to increase the font size. The portal uses Twitter Bootstrap for styling; they have great documentation on changing the look and feel of topics using their framework. There’s also a short topic on that in this sample content.
The next common thing is to change strings (from here on out I’ll call them labels) within the portal, things like the portal name or the footer of each page. There’s a topic on how to do that, too. It also tells you how to add labels for other languages.
If you want to modify the portal, or the metadata in the database, you’re going to have to learn the portal code itself. It’s written using Sinatra, a Ruby DSL, with all the content stored in Apache CouchDB. Maybe some day I’ll document some stuff related to that, but until then, read the code, Luke!
If you want to help, send me a push request. Due to the nature of this portal, I may need to ask you to agree to some licensing requirements (yep, I work with lawyers), but don’t let that scare you. I’d appreciate your help.


One of the best and most meaningful features of HTML5 is its introduction of more “semantic” tags, or tags that help define the structure of a webpage. Tags like
section
,
article
,
footer
,
nav
, and
aside
are highly useful for improving the accessibility of a website for visually impaired users. They provide valuable information about your site to any screen readers that are processing it, allowing for easier browsing and less time wasted with repeated or irrelevant information.
Semantic tags improve your site's SEO rankings for the same reason — they help search engines understand what your site is about. And on a more basic level, these tags make it easier for developers to understand what role each element plays on a particular page, increasing maintainability.
So where does semantic HTML fit into the React.js framework?
React requires that any render
function returns a single parent element that contains the rest of the content. Depending on the complexity of your UI, this rule can result in an bulky Matryoshka doll of div
s, div
s, and more div
s. The benefits of semantic HTML can get muddied by just how easy it is to stick another handy, neutral div
in your component tree, especially when (out of habit) you start using div
s in place of more semantically useful tags, like button
or nav
.
Enter React v16.2.0, released in November 2017, which introduced an awesome new feature called Fragments :
Fragments look like empty JSX tags. They let you group a list of children without adding extra nodes to the DOM.
With this addition to the React framework, there’s no reason to bulk up the DOM with more div
tags. There’s a handier, even more neutral tag in town that does exactly what we need.
render() {
return (
<>

Content title

Sample content

</>
)
}
Fragments are a way not only to streamline your webpage, but also to get out of the habit of using a div
when another, more specific tag would make sense. Let’s make the internet a more accessible place by remembering that for some consumers, semantic HTML isn’t just "nice to have." It’s essential for navigating your UI.
And hey — no more sifting through div
s to debug your front end, am I right?
Cross-posted on the 20spokes blog


About
Add your about here
- Degree: Pursuing B.Tech
- City: Delhi, India
- Website: website.com
- Mail<EMAIL_ADDRESS>Skills
Education & Experience
Education
IITD
2019 - 2023
Bachelor of Technology (IT)
CGPA: 10
Delhi Public School
2004 - 2018
High School
Experience
Campus Ambassador Intern
April 2020 - May 2020
Internshala
Personal Projects
Courses & Certificates
Data Structures & algorithms in C++ by Coding Ninjas
This was a great course and helped me understand all the basics of C++, data structures & algorithms.
View Certificate
Web Design Specialization by University Of Michigan
This course taught me all about HTML, CSS, JavaScript and Bootstrap. It was a wonderful experience doing it.
View Certificate
Problem Solving (Basic) Skill Certification
Cleared this HackerRank Skill Certification Test. It covered basic topics of Data Structures (such as Arrays, Strings) and Algorithms (such as Sorting and Searching).
View Certificate
Python Specialization by University Of Michigan
The course was on Python3 and covered wide range of topics like basics of python, DS, SQL, accesing web with python. It helped me get an overall overview of python programming.
View Certificate
Contact
Location:
New Delhi, Delhi, India
Email:
mail@gmail.com


{% extends 'base.html' %} {% block pagetitle %}Brian R. Bondy - Theoretical Computer Science expected age by tag list{% endblock %} {% block title %} Theoretical Computer Science expected age by tag list{% endblock %} {% block subtitle %}Calculated by using the expected value for the age each answer comes from{% endblock %} {% block main_content %}
This list contains the expected age per tag from the the Theoretical Computer Science site, sorted by expected age.
The list was generated with the Theoretical Computer Science April 2011 data dump on 4/25/2011 10:48:35 PM.
The creator of this list is Brian R. Bondy: Blog, Twitter, StackOverflow.
Please see the following link for other lists.


Policy
With utmost consideration for the safety of Life and Property and the Protection of Environment, the Company dedicates itself to meet the expectations of its customers and the aspirations of its Stakeholders by ensuring that effective Safety and Quality Management Systems are in place that comply with the relevant National and International Codes, Standards, Statutory and Regulatory Requirements.
In line with our strategy to be a market leader and a preferred safe service provider, we shall monitor and ensure the effectiveness and continual improvement of our systems, leading to excellence.
With our firm belief in team success, we shall achieve our objectives.
Objectives
- Providing safe practices in ship operation and safe working environment.
- Establishing safeguards against all identified risks.
- Continuously improving safety management skills of personnel ashore and aboard ships & rigs, including preparing for emergencies related both to safety and environmental protection.
- Providing training and adequate resources to a highly motivated and an empowered workforce with due regard to their health and safety.
This policy shall be implemented and maintained at all levels of the organization- ship based, rig based and shore based.


Payroll Managements System For TaffResto Bar (C#)
This is the Log In Form of Taff RestoBar Payroll Managemeny System .
Home Form use to calculate the Allowance of Employee in Taff RestoBar.
Add Employee Form use to Add New Employee.
Record Form Show The PaySlip Record.
Update Employee Form use to Update or Delete Employee Record.
Smart Phone Inventory Management System (C#)
This is the Home Form of Smartphone Inventory.
This Form is use to Order Smartphone.
In this Form you can Add New Smartphone Brand and Add Stack or Delete any Product .
This is The Record List of Costumer Who Buy Smartphone .
Payroll Managements System For TaffResto Bar (Php)
Home Page use to calculate the Allowance of Employee in Taff RestoBar.
This Page Show the Employee Allowance Record of Taff Resto Bar.
This Page Show the Employee Information List.
Operating System Simulation (C#)


First name is required.
Last name is required.
Address is required.
City is required.
State is required.
Zip Code is required.
Country is required.
Date of birth is required.
Gender is required.
Email address is required.
Email address is invalid.
Password is required.
{{passwordError}}


Open Start menu > Programs > The Interactive Classroom > Scores Upload
{% extends "base.html" %} {% block tag_header_content %}
Before deinstalling software, please follow these instructions.
Open Start menu > Programs > The Interactive Classroom > Scores Upload
Click on the Backup Scores
button.
Then click on the Change
button.
Pick a location. From the screen that appears, choose Drive
and then select either your USB Disk or your Floppy Drive (e.g., A:) to copy the scores to.
Click OK
, and then click the Backup
button.
Wait a moment until you receive this message:
Your scores have been successfully copied.
Start > Programs > The Interactive Classroom > Deinstall Software
Warning: DO NOT close the deinstaller dialog until you have completed ALL the steps here.
Important: Copy the following entry code into the Computer Tutor deinstallation screen on your computer and complete the deinstallation process.
The deactivation entry code depends on your timezone.
{{ deactivation_entry_code }} (Depends on your timezone.)
Please type your computer ID to proceed.


Ayodhya Verdict: 5 acres have no value for us, says Muslim parties’ lawyer Zafaryab Jilani
Reiterating his appeal to maintain calm and not protest, Jilani said, "It is not a defeat. We will discuss if review petition should be filed or not"
Zafaryab Jilani, the counsel for the Muslim parties said that he was not satisfied with the verdict delivered by the Supreme Court of India (SC) in the Ayodhya land dispute case, on November 9.
The apex court ruled that the disputed land in Ayodhya, Uttar Pradesh will be given to the Hindus party Ram Lalla Virajman, subject to certain conditions. An alternate plot of land will be given to the Sunni Waqf Board to construct a mosque.
Also read: Supreme Court awards land to Hindu side; Muslims to get alternative plot for mosque
The Chief Justice of India (CJI) Ranjan Gogoi, who read the unanimous judgement, allocated five acres of land to the Sunni Waqf Board and noted that "wrongs committed must be limited", while referring to demolition of the Babri Masjid in 1992.
To this, Jilani said, "Five acres has no value for us. We are not satisfied at all."
Appealing for peace, Jilani said: "We will decide the future course of action after reading the judgment. There are several contradictions and some incorrect findings also."
He clarified that the inner courtyard is of concern to them and not the outer courtyard.
Reiterating his appeal to maintain calm and not protest, he said, "It is not a defeat. We will discuss if review petition should be filed or not."
For live updates on the Ayodhya Verdict, click here Get access to India's fastest growing financial subscriptions service Moneycontrol Pro for as little as Rs 599 for first year. Use the code "GETPRO". Moneycontrol Pro offers you all the information you need for wealth creation including actionable investment ideas, independent research and insights & analysis For more information, check out the Moneycontrol website or mobile app.


| Top |
Functions
Types and Values
| struct | NcmSFSphericalHarmonicsK |
| struct | NcmSFSphericalHarmonicsP |
| #define | NCM_SF_SPHERICAL_HARMONICS_MAX_LEN |
| #define | NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL |
| #define | NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL |
| #define | NCM_SF_SPHERICAL_HARMONICS_EPS |
| #define | NCM_SF_SPHERICAL_HARMONICS_LATERAL_MOVE |
| const gdouble | sn_2l0_5 |
| const gdouble | snm1_2l0_2 |
| const gdouble | sqrt1mx2 |
| const gdouble | x |
| const gint | l0 |
| const gint | m |
| const gint | twol0 |
| const gint | l0mm |
| const gint | l0pm |
| const gdouble | Llp1 |
| const gdouble | Ll |
| const gdouble | Mlp1 |
| const gdouble | Ml |
| const gdouble | Pl0m |
| const gdouble | Pl0p1m |
| gdouble | min_Plm |
| const gdouble | abs_Plm |
| const gint | lmax |
Object Hierarchy
GBoxed ├── NcmSFSphericalHarmonicsY ╰── NcmSFSphericalHarmonicsYArray GObject ╰── NcmSFSphericalHarmonics
Functions
ncm_sf_spherical_harmonics_Y_new ()
NcmSFSphericalHarmonicsY * ncm_sf_spherical_harmonics_Y_new (NcmSFSphericalHarmonics *spha
,const gdouble abstol
);
FIXME
ncm_sf_spherical_harmonics_Y_dup ()
NcmSFSphericalHarmonicsY *
ncm_sf_spherical_harmonics_Y_dup (NcmSFSphericalHarmonicsY *sphaY
);
FIXME
ncm_sf_spherical_harmonics_Y_free ()
void
ncm_sf_spherical_harmonics_Y_free (NcmSFSphericalHarmonicsY *sphaY
);
FIXME
ncm_sf_spherical_harmonics_Y_get_lm ()
gdouble
ncm_sf_spherical_harmonics_Y_get_lm (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_get_lp1m ()
gdouble
ncm_sf_spherical_harmonics_Y_get_lp1m (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_get_x ()
gdouble
ncm_sf_spherical_harmonics_Y_get_x (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_get_l ()
gint
ncm_sf_spherical_harmonics_Y_get_l (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_get_m ()
gint
ncm_sf_spherical_harmonics_Y_get_m (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_next_l ()
void
ncm_sf_spherical_harmonics_Y_next_l (NcmSFSphericalHarmonicsY *sphaY
);
Move the recursion for $x$ to $l = l + 1$.
ncm_sf_spherical_harmonics_Y_next_l2 ()
void ncm_sf_spherical_harmonics_Y_next_l2 (NcmSFSphericalHarmonicsY *sphaY
,gdouble * restrict Yblm
);
Move the recursion for $x$ to $l = l + 2$.
ncm_sf_spherical_harmonics_Y_next_l4 ()
void ncm_sf_spherical_harmonics_Y_next_l4 (NcmSFSphericalHarmonicsY *sphaY
,gdouble * restrict Yblm
);
Move the recursion for $x$ to $l = l + 4$.
ncm_sf_spherical_harmonics_Y_next_l2pn ()
void ncm_sf_spherical_harmonics_Y_next_l2pn (NcmSFSphericalHarmonicsY *sphaY
,gdouble * restrict Yblm
,const gint n
);
ncm_sf_spherical_harmonics_Y_next_m ()
void
ncm_sf_spherical_harmonics_Y_next_m (NcmSFSphericalHarmonicsY *sphaY
);
Restart the recursion for $x$ at $l = m + 1,\; m = m + 1$. If the value of $Ybll < a$ where $a$ is the absolute tolerance, advance $l$ until the tolerance is reached.
ncm_sf_spherical_harmonics_Y_reset ()
void
ncm_sf_spherical_harmonics_Y_reset (NcmSFSphericalHarmonicsY *sphaY
);
ncm_sf_spherical_harmonics_Y_array_new ()
NcmSFSphericalHarmonicsYArray * ncm_sf_spherical_harmonics_Y_array_new (NcmSFSphericalHarmonics *spha
,const gint len
,const gdouble abstol
);
FIXME
ncm_sf_spherical_harmonics_Y_array_dup ()
NcmSFSphericalHarmonicsYArray *
ncm_sf_spherical_harmonics_Y_array_dup
(NcmSFSphericalHarmonicsYArray *sphaYa
);
FIXME
ncm_sf_spherical_harmonics_Y_array_free ()
void
ncm_sf_spherical_harmonics_Y_array_free
(NcmSFSphericalHarmonicsYArray *sphaYa
);
FIXME
ncm_sf_spherical_harmonics_Y_array_get_lm ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_lm (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,const gint i
);
ncm_sf_spherical_harmonics_Y_array_get_lp1m ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_lp1m (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,const gint i
);
ncm_sf_spherical_harmonics_Y_array_get_x ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_x (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint i
);
ncm_sf_spherical_harmonics_Y_array_get_l ()
gint
ncm_sf_spherical_harmonics_Y_array_get_l
(NcmSFSphericalHarmonicsYArray *sphaYa
);
ncm_sf_spherical_harmonics_Y_array_get_m ()
gint
ncm_sf_spherical_harmonics_Y_array_get_m
(NcmSFSphericalHarmonicsYArray *sphaYa
);
ncm_sf_spherical_harmonics_Y_array_next_l ()
void ncm_sf_spherical_harmonics_Y_array_next_l (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
);
ncm_sf_spherical_harmonics_Y_array_next_l2 ()
void ncm_sf_spherical_harmonics_Y_array_next_l2 (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,gdouble * restrict Yblm
);
ncm_sf_spherical_harmonics_Y_array_next_l4 ()
void ncm_sf_spherical_harmonics_Y_array_next_l4 (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,gdouble * restrict Yblm
);
ncm_sf_spherical_harmonics_Y_array_next_l2pn ()
void ncm_sf_spherical_harmonics_Y_array_next_l2pn (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,gdouble * restrict Yblm
,const gint n
);
ncm_sf_spherical_harmonics_Y_array_next_m ()
void ncm_sf_spherical_harmonics_Y_array_next_m (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
);
ncm_sf_spherical_harmonics_Y_array_reset ()
void ncm_sf_spherical_harmonics_Y_array_reset (NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
);
ncm_sf_spherical_harmonics_new ()
NcmSFSphericalHarmonics *
ncm_sf_spherical_harmonics_new (const gint lmax
);
Creates a new NcmSFSphericalHarmonics object.
ncm_sf_spherical_harmonics_ref ()
NcmSFSphericalHarmonics *
ncm_sf_spherical_harmonics_ref (NcmSFSphericalHarmonics *spha
);
Increase the reference of spha
by one.
ncm_sf_spherical_harmonics_free ()
void
ncm_sf_spherical_harmonics_free (NcmSFSphericalHarmonics *spha
);
Decrease the reference count of spha
by one.
ncm_sf_spherical_harmonics_clear ()
void
ncm_sf_spherical_harmonics_clear (NcmSFSphericalHarmonics **spha
);
Decrease the reference count of spha
by one, and sets the pointer *spha
to
NULL.
ncm_sf_spherical_harmonics_set_lmax ()
void ncm_sf_spherical_harmonics_set_lmax (NcmSFSphericalHarmonics *spha
,const gint lmax
);
Sets the maximum l to lmax
.
ncm_sf_spherical_harmonics_get_lmax ()
gint
ncm_sf_spherical_harmonics_get_lmax (NcmSFSphericalHarmonics *spha
);
Gets the maximum l to lmax
.
ncm_sf_spherical_harmonics_start_rec ()
void ncm_sf_spherical_harmonics_start_rec (NcmSFSphericalHarmonics *spha
,NcmSFSphericalHarmonicsY *sphaY
,const gdouble theta
);
Start recursion for $\theta$ at $l = 0,\; m = 0$.
ncm_sf_spherical_harmonics_start_rec_array ()
void ncm_sf_spherical_harmonics_start_rec_array (NcmSFSphericalHarmonics *spha
,NcmSFSphericalHarmonicsYArray *sphaYa
,const gint len
,const gdouble *theta
);
Start recursion for the array $\theta_i$ at $l = 0,\; m = 0$. The array theta
must have
length len
.
ncm_sf_spherical_harmonics_get_Klm ()
NcmSFSphericalHarmonicsK * ncm_sf_spherical_harmonics_get_Klm (NcmSFSphericalHarmonics *spha
,const gint l0
,const gint m
);
Gets an array of NcmSFSphericalHarmonicsK with the coeficients necessary to move the recurence from $(l_0, m)\; \to\; (l_\mathrm{max}, m)$.
[skip]
Returns
a pointer to an array of NcmSFSphericalHarmonicsK.
[array][element-type NcmSFSphericalHarmonicsK]
Types and Values
struct NcmSFSphericalHarmonicsK
struct NcmSFSphericalHarmonicsK { gdouble l; gdouble lp1; };
Recurrence coefficients.
struct NcmSFSphericalHarmonicsP
struct NcmSFSphericalHarmonicsP { gdouble x; gdouble sqrt1mx2; gdouble l0m; gdouble l0p1m; gdouble lm; gdouble lp1m; };
Boxed P values.
NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL
#define NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL (1.0e-20)
NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL
#define NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL (1.0e-40)
abs_Plm
const gdouble abs_Plm = fabs (sphaYa->Ylm[NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX (i, 0, len)]);


| Actions (94%) |
| BiFunctions (93%) |
| BiPredicates (100%) |
| Bytes (92%) |
| Callables (100%) |
| Consumers (88%) |
| Flowables (66%) |
| Functions (93%) |
| IO (93%) |
| Maybes (100%) |
| Observables (53%) |
| Predicates (83%) |
| RetryWhen (80%) |
| SchedulerHelper (87%) |
| StateMachine (97%) |
| StateMachine2 (90%) |
| Statistics (100%) |
| Strings (96%) |


The beaver in the green area just had a great idea. Every day, the beavers that know this idea, will share it with their friends, that are connected to them with lines.
Place in the blue area, the beavers who will be the last ones to learn about the idea.
You can click on "validate" to see an example.
To help you, start by reorganizing the beavers within the white area.


- Getting started with TealinuxOS
- TealinuxOS Installation
- Migration and Upgrade
- Introducing Desktop Environment
- Settings and Options
- Default App Introduction
- Network and Internet Connection
- Printing and Scanning
- Managing Installed Apps
- Maintaining Computer Securoty
- Hardwares
- Administrative Tasks
- Command Line
Default App Introduction
Multimedia Applications
Audacious
Audacious is a free licensed media player software that focuses on the use of low computer resources, high voice quality and supports various types of formats. To find out more please visit the audacious official website Audacious.
VLC
VLC Media Player is a software of various multimedia files, both video and audio in various formats, such as MPEG, DivX, Ogg, and others. VLC Media Player can also be used to play DVD, VCD, or CD. VLC Media Player is open source and available for various operating systems. Starting from Microsoft Windows, various Linux distros, Mac OS, and several other operating systems VLC.
Multimedia Codec
Multimedia Codec library that allows you to play your favorite videos and music.
Office Applications
LibreOffice 5
TeaLinuxOS Pappermint has provided LibreOffice writer for LibreOffice writer for document processing, LibreOffice Impress for presentation processing, LibreOffice Calc for spreadsheet data processing and many other LibreOffice packages. For more information please visit the official website LibreOffice.
 TeaLinuxOS Pappermint brings Firefox browser as deffault browser to support user productivity. To find out about Firefox and its various features you can visit the official website Firefox.
System
Tea Package
Install all apps with complete dependencies easily with Tea Package.
Tea Package is an application developed by the PythonOS-based TeaLinuxOS developer script to install the app along with all its dependencies offline. This makes it easy for users to share application packages and install them without having to be connected to the internet. If you are familiar with .exe in windows operating system then in TeaLinuxOS Pappermint has .tea for application package used. Installing .tea can be done on Tea Package Installer. To find out about this project please look at github Tea Package.
TeaLinux Module Installer
TeaLinuxOS Module Installer is an installation of offline programming application using CD/DVD that has been filled with various application modules. The application modules provided include for the Programming Module containing Android Studio app, C/C++ compiler, apache2, PHP5, MySQL, PyCharm, Atom, NodeJs + npm, Geany, MonoDevelop, Brackets, NetBeans, Eclipse, and Qt. The Multimedia Module contains Blender, Inkscape, GIMP, Audacity, LMMS, Ardour, Synfig, Darktable, FFMPEG, and Krita apps. As for the VirtualBox Networking Module, traceroute, remmina, wireshark, and gigolo.
These modules can be installed by entering TealinuxOS DVD then click
→ Accessoris → TeaLinux Module Installer select the modules you want, then click Install.
Lapor Hama
Lapor Hama (pest report) is an application to easily report bugs or suggestions for the TeaLinuxOS operating system, so we hope to find out a better gap in TeaLinux OS for TeaLinuxOS.
In addition through this app, you can also report the TeaLinux OS pests at tealinuxos.org/lapor.
Edit this page on Github


{% extends "header_memoranda.html" %} {% block memoranda %}
These operations are inherently time consuming, please be patient.


I’m an avid R user and rarely use anything else for data analysis and visualisations. But while R is my go-to, in some cases, Python might actually be a better alternative.
That’s why I wanted to see how R and Python fare in a one-on-one comparison of an analysis that’s representative of what I would typically work with.
Conclusions
All in all, the Python code could easily be translated into R and was comparable in length and simplicity between the two languages. While Python’s syntax is inherently cleaner/ tidier, we can use packages that implement piping in R and achieve similar results (even though Python’s dot-separated syntax is still much easier to type than using the piping operator of magrittr). For plotting and visualisation I still think that R’s ggplot2 is top of the line in both syntax, customizability and outcome (admittedly, I don’t know matplotlib as well as ggplot)! In terms of functionality, I couldn’t find major differences between the two languages and I would say they both have their merits. For me, R comes more natural as that is what I’m more fluent in, but I can see why Python holds an appeal too and I think I’ll make more of an effort to use both languages in my future projects.
R and Python
R and Python are both open-source languages used in a wide range of data analysis fields. Their main difference is that R has traditionally been geared towards statistical analysis, while Python is more generalist. Both comprise a large collection of packages for specific tasks and have a growing community that offers support and tutorials online.
For a nice overview of the languages respective strengths and weaknesses, check out Datacamp’s nice infographic.
Comparative analysis of genome data
To directly compare R and Python, I am following Zhuyi Xue’s “A Comprehensive Introduction To Your Genome With the SciPy Stack” (with some minor tweaks here and there). He gives a nice introduction to the data, so I will not repeat it here but focus on the comparison between the code lines.
For R, I am working with RStudio, for Python with Anaconda and Spyder.
Python:
For this analysis, we need the SciPy stack with pandas for data wrangling and matplotlib for visualisation. Anaconda already comes with all these packages that we need. Zhuyi Xue first imports pandas as “pd”, so that we can call pandas function by prefixing them with “pd.”.
import pandas as pd
R:
While the code could be replicated with base R, I prefer dplyr for data wrangling and ggplot2 for visualisation.
library(dplyr)
library(ggplot2)
Reading in data
Reading in data is straight forward in both R and Python. The code we need to read in the file is comparable between R and Python. Zhuyi Xue specified “compression = ‘gzip’”, but this would not have been necessary as the default is to infer it from the file suffix.
One big difference in the general syntax we can see here too: Boolean true/false values are written in all caps in R (TRUE/FALSE), while Python uses first letter capitalisation (True/False). The same prinicple applies to “none”.
Python:
df = pd.read_csv('Homo_sapiens.GRCh38.85.gff3.gz',
compression = 'gzip',
sep = '\t',
comment = '#',
low_memory = False,
header = None,
names = ['seqid', 'source', 'type', 'start', 'end', 'score', 'strand', 'phase', 'attributes'])
df.head()
R:
df <- read.csv("~/Documents/Github/Homo_sapiens.GRCh38.85.gff3.gz",
header = FALSE,
sep = "\t",
col.names = c('seqid', 'source', 'type', 'start', 'end', 'score', 'strand', 'phase', 'attributes'),
comment.char = "#")
head(df)
## seqid source type start end score strand phase
## 1 1 GRCh38 chromosome 1 248956422 . . .
## 2 1 . biological_region 10469 11240 1.3e+03 . .
## 3 1 . biological_region 10650 10657 0.999 + .
## 4 1 . biological_region 10655 10657 0.999 - .
## 5 1 . biological_region 10678 10687 0.999 + .
## 6 1 . biological_region 10681 10688 0.999 - .
## attributes
## 1 ID=chromosome:1;Alias=CM000663.2,chr1,NC_000001.11
## 2 external_name=oe %3D 0.79;logic_name=cpg
## 3 logic_name=eponine
## 4 logic_name=eponine
## 5 logic_name=eponine
## 6 logic_name=eponine
Examining data
- listing unique strings
The first thing we want to know from the data is how many unique entries there are in the “seqid” column.
Here, we can already see the main difference in syntax between R and Python:
Python concatenates the object name (“df) with the column name and the functions that we want to run on this column in a sequential manner, separated by a dot. Base R uses nested functions, where each function is called with “function_name()” and we specify columns with “object_name$column_name”.
However, both R and Python can also call columns in a dataframe with “[ ]” with the difference that Python per default subsets data columns df[“seqid”], while R always needs index specifications for rows and columns, separated by “,”: e.g. df[, “seqid”] would subset every row and only the column named “seqid”.
The sequential calling of functions is indeed very handy, it makes the code easier to read and understand than lots of interwoven functions and brackets. But while this isn’t the concept of base R, dplyr uses the magrittr principle of chaining functions with the pipe symbol “%>%”. Even though this symbol isn’t as easily typed, it’s functionality is often superior to base R, especially if you need to run many functions on a dataframe. However, with just or two functions, I usually keep to base R as it is shorter.
Python:
df.seqid.unique() # alternatively: df['seqid'].unique()
R:
unique(df$seqid)
## [1] 1 10 11 12 13 14
## [7] 15 16 17 18 19 2
## [13] 20 21 22 3 4 5
## [19] 6 7 8 9 GL000008.2 GL000009.2
## [25] GL000194.1 GL000195.1 GL000205.2 GL000208.1 GL000213.1 GL000214.1
## [31] GL000216.2 GL000218.1 GL000219.1 GL000220.1 GL000221.1 GL000224.1
## [37] GL000225.1 GL000226.1 KI270302.1 KI270303.1 KI270304.1 KI270305.1
## [43] KI270310.1 KI270311.1 KI270312.1 KI270315.1 KI270316.1 KI270317.1
## [49] KI270320.1 KI270322.1 KI270329.1 KI270330.1 KI270333.1 KI270334.1
## [55] KI270335.1 KI270336.1 KI270337.1 KI270338.1 KI270340.1 KI270362.1
## [61] KI270363.1 KI270364.1 KI270366.1 KI270371.1 KI270372.1 KI270373.1
## [67] KI270374.1 KI270375.1 KI270376.1 KI270378.1 KI270379.1 KI270381.1
## [73] KI270382.1 KI270383.1 KI270384.1 KI270385.1 KI270386.1 KI270387.1
## [79] KI270388.1 KI270389.1 KI270390.1 KI270391.1 KI270392.1 KI270393.1
## [85] KI270394.1 KI270395.1 KI270396.1 KI270411.1 KI270412.1 KI270414.1
## [91] KI270417.1 KI270418.1 KI270419.1 KI270420.1 KI270422.1 KI270423.1
## [97] KI270424.1 KI270425.1 KI270429.1 KI270435.1 KI270438.1 KI270442.1
## [103] KI270448.1 KI270465.1 KI270466.1 KI270467.1 KI270468.1 KI270507.1
## [109] KI270508.1 KI270509.1 KI270510.1 KI270511.1 KI270512.1 KI270515.1
## [115] KI270516.1 KI270517.1 KI270518.1 KI270519.1 KI270521.1 KI270522.1
## [121] KI270528.1 KI270529.1 KI270530.1 KI270538.1 KI270539.1 KI270544.1
## [127] KI270548.1 KI270579.1 KI270580.1 KI270581.1 KI270582.1 KI270583.1
## [133] KI270584.1 KI270587.1 KI270588.1 KI270589.1 KI270590.1 KI270591.1
## [139] KI270593.1 KI270706.1 KI270707.1 KI270708.1 KI270709.1 KI270710.1
## [145] KI270711.1 KI270712.1 KI270713.1 KI270714.1 KI270715.1 KI270716.1
## [151] KI270717.1 KI270718.1 KI270719.1 KI270720.1 KI270721.1 KI270722.1
## [157] KI270723.1 KI270724.1 KI270725.1 KI270726.1 KI270727.1 KI270728.1
## [163] KI270729.1 KI270730.1 KI270731.1 KI270732.1 KI270733.1 KI270734.1
## [169] KI270735.1 KI270736.1 KI270737.1 KI270738.1 KI270739.1 KI270740.1
## [175] KI270741.1 KI270742.1 KI270743.1 KI270744.1 KI270745.1 KI270746.1
## [181] KI270747.1 KI270748.1 KI270749.1 KI270750.1 KI270751.1 KI270752.1
## [187] KI270753.1 KI270754.1 KI270755.1 KI270756.1 KI270757.1 MT
## [193] X Y
## 194 Levels: 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 3 4 5 6 7 8 ... Y
# with dplyr:
# df %>% select(seqid) %>% unique
- how many unique seqids are there?
To get the number of unique entries in the “seqid” column, we simply need to append “.shape” to the above Python code. In R, we can either wrap the above R code with the “length()” function or use dplyr and piping instead. If we use the latter, we need to use the “nrow()” function because base R returns a vector, while dplyr returns a dataframe. Here, we can see that with two functions, using dplyr is still a bit more code but it already looks much tidier.
Python:
df.seqid.unique().shape
R:
length(unique(df$seqid))
## [1] 194
# with dplyr:
# df %>% select(seqid) %>% unique %>% nrow
- counting occurrences
To count the frequencies of each unique entry in the “source” column, we use the “value_counts()” function in Python and the “table()” function in R. These two functions differ in how they sort the output table: value_counts() sorts by decreasing frequency, while R alphabetically sorts the variables. To order the data as in Python, we need to add the “sort()” function to our R code.
Python:
df.source.value_counts()
R:
# table(df$source) is per default ordered alphabetically, if we want it ordered by decreasing counts, like with Python:
sort(table(df$source), decreasing = TRUE)
##
## havana ensembl_havana ensembl . mirbase
## 1441093<PHONE_NUMBER>12<PHONE_NUMBER>
## GRCh38 insdc
## 194 74
# dplyr:
# df %>% select(source) %>% table %>% sort(decreasing = TRUE)
How Much of the Genome Is Incomplete?
- subsetting a dataframe
We are now subsetting our original dataframe and assign it a new object name with “ = “ or “ <- “.
To subset the dataframe to keep only rows which say “GRCh38” in the “source” column, ther are several ways to do this in R: the way that would be directly comparable to how it was done in Python would be to also use the square bracket indexing. However, there are two solutions which are more elegant: 1) base R’s “subset()” or dplyr’s “filter()” function. But with this short example, there is no big difference between the three.
Python’s “shape” gives us the same information as R’s “dim()” function: how many rows and columns our dataframe has.
To preview a random subset of 10 rows from our dataframe, we use Python’s “sample()” and dplyr’s “sample_n()” function.
 It should contain the gene lengths, i.e. the distance in base pairs between the start and end point on the chromosomes (“start” and “end” columns). In R we don’t need to copy the dataframe first but the rest of the code is very similar: we define a new column name for the dataframe and assign its value by subtracting the values of the “start” from the values of the “end” column (+1). Here, we can see again that in Python we use a dot to define columns, while R uses the Dollar sign.
The sum of all lengths is calculated with the “sum()” function in both languages.
Python:
gdf = gdf.copy()
gdf['length'] = gdf.end - gdf.start + 1
gdf.length.sum()
R:
gdf$length <- gdf$end - gdf$start + 1
sum(gdf$length)
## [1]<PHONE_NUMBER>
Next, we want to calculating the proportion of the genome that is not on main chromosome assemblies. For that, we first define a character string with the main chromosomes: 1 to 23, X, Y and MT (mitochondrial chromosome). Defining this string is a bit easier in R.
We will use this string to calculate the sum of lengths of the subsetted dataframe and divide it by the sum of lengths of the whole dataframe. For subsetting, we use the “isin()” function of Python, which corresponds to R’s “%in%”.
Python:
chrs = [str(_) for _ in range(1, 23)] + ['X', 'Y', 'MT']
gdf[-gdf.seqid.isin(chrs)].length.sum() / gdf.length.sum()
# or
gdf[(gdf['type'] == 'supercontig')].length.sum() / gdf.length.sum()
R:
chrs <- c(1:23, "X", "Y", "MT")
sum(subset(gdf, !seqid %in% chrs)$length) / sum(gdf$length)
## [1] 0.003702192
How Many Genes Are There?
Here, we are again using the same functions as above for subsetting the dataframe, asking for its dimensions, printing 10 random lines and asking for the frequencies of each unique item in the “type” column. For the latter I am using base R over dplyr, because it’s faster to type.
Python:
edf = df[df.source.isin(['ensembl', 'havana', 'ensembl_havana'])]
edf.shape
edf.sample(10)
edf.type.value_counts()
R:
edf <- subset(df, source %in% c("ensembl", "havana", "ensembl_havana"))
dim(edf)
## [1] 2414370 9
sample_n(edf, 10)
## seqid source type start end score
## 2548897 X ensembl three_prime_UTR 67723842 67730618 .
## 790670 15 ensembl_havana CDS 42352030 42352139 .
## 1298369 19 havana CDS 38942683 38942751 .
## 189728 1 ensembl_havana CDS 186304108 186304257 .
## 1080599 17 havana exon 44401337 44401453 .
## 1562968 20 ensembl_havana exon 2964272 2964350 .
## 1965100 5 ensembl transcript<PHONE_NUMBER>97 .
## 2581554 X havana exon 147927670 147928807 .
## 785399 15 havana exon 40611478 40611511 .
## 1417830 2 ensembl_havana CDS 71520178 71520208 .
## strand phase
## 2548897 + .
## 790670 + 2
## 1298369 - 0
## 189728 + 2
## 1080599 - .
## 1562968 + .
## 1965100 - .
## 2581554 + .
## 785399 + .
## 1417830 + 0
## attributes
## 2548897 Parent=transcript:ENST00000612452
## 790670 ID=CDS:ENSP00000326227;Parent=transcript:ENST00000318010;protein_id=ENSP00000326227
## 1298369 ID=CDS:ENSP00000472465;Parent=transcript:ENST00000599996;protein_id=ENSP00000472465
## 189728 ID=CDS:ENSP00000356453;Parent=transcript:ENST00000367483;protein_id=ENSP00000356453
## 1080599 Parent=transcript:ENST00000585614;Name=ENSE00002917300;constitutive=0;ensembl_end_phase=2;ensembl_phase=2;exon_id=ENSE00002917300;rank=7;version=1
## 1562968 Parent=transcript:ENST00000216877;Name=ENSE00003603687;constitutive=1;ensembl_end_phase=1;ensembl_phase=-1;exon_id=ENSE00003603687;rank=4;version=1
## 1965100 ID=transcript:ENST00000362670;Parent=gene:ENSG00000199540;Name=Y_RNA.43-201;biotype=misc_RNA;tag=basic;transcript_id=ENST00000362670;transcript_support_level=NA;version=1
## 2581554 Parent=transcript:ENST00000620828;Name=ENSE00003724969;constitutive=0;ensembl_end_phase=-1;ensembl_phase=-1;exon_id=ENSE00003724969;rank=1;version=1
## 785399 Parent=transcript:ENST00000399668;Name=ENSE00003659959;constitutive=0;ensembl_end_phase=2;ensembl_phase=1;exon_id=ENSE00003659959;rank=7;version=1
## 1417830 ID=CDS:ENSP00000398305;Parent=transcript:ENST00000429174;protein_id=ENSP00000398305
sort(table(edf$type), decreasing = TRUE)
##
## exon CDS
## 1180596 704604
## five_prime_UTR three_prime_UTR
##<PHONE_NUMBER>38
## transcript gene
## 96375 42470
## processed_transcript aberrant_processed_transcript
## 28228 26944
## NMD_transcript_variant lincRNA
## 13761 13247
## processed_pseudogene lincRNA_gene
## 10722 7533
## pseudogene RNA
## 3049 2221
## snRNA snRNA_gene
## 1909 1909
## snoRNA snoRNA_gene
## 956 944
## pseudogenic_transcript rRNA
## 737 549
## rRNA_gene miRNA
## 549 302
## V_gene_segment J_gene_segment
## 216 158
## VD_gene_segment C_gene_segment
## 37 29
## biological_region chromosome
## 0 0
## miRNA_gene mt_gene
## 0 0
## supercontig
## 0
Now we want to subset the dataframe to rows with the attribute “gene” in the “type” column, look at 10 random lines from the “attributes” column and get the dataframe dimensions.
Python:
ndf = edf[edf.type == 'gene']
ndf = ndf.copy()
ndf.sample(10).attributes.values
ndf.shape
R:
ndf <- subset(edf, type == "gene")
sample_n(ndf, 10)$attributes
## [1] ID=gene:ENSG00000170949;Name=ZNF160;biotype=protein_coding;description=zinc finger protein 160 [Source:HGNC Symbol%3BAcc:HGNC:12948];gene_id=ENSG00000170949;havana_gene=OTTHUMG00000182854;havana_version=3;logic_name=ensembl_havana_gene;version=17
## [2] ID=gene:ENSG00000215088;Name=RPS5P3;biotype=processed_pseudogene;description=ribosomal protein S5 pseudogene 3 [Source:HGNC Symbol%3BAcc:HGNC:10427];gene_id=ENSG00000215088;havana_gene=OTTHUMG00000065532;havana_version=1;logic_name=havana;version=3
## [3] ID=gene:ENSG00000249077;Name=RP11-478C1.8;biotype=processed_pseudogene;gene_id=ENSG00000249077;havana_gene=OTTHUMG00000160290;havana_version=1;logic_name=havana;version=1
## [4] ID=gene:ENSG00000110619;Name=CARS;biotype=protein_coding;description=cysteinyl-tRNA synthetase [Source:HGNC Symbol%3BAcc:HGNC:1493];gene_id=ENSG00000110619;havana_gene=OTTHUMG00000010927;havana_version=9;logic_name=ensembl_havana_gene;version=16
## [5] ID=gene:ENSG00000168010;Name=ATG16L2;biotype=protein_coding;description=autophagy related 16 like 2 [Source:HGNC Symbol%3BAcc:HGNC:25464];gene_id=ENSG00000168010;havana_gene=OTTHUMG00000167961;havana_version=2;logic_name=ensembl_havana_gene;version=10
## [6] ID=gene:ENSG00000055957;Name=ITIH1;biotype=protein_coding;description=inter-alpha-trypsin inhibitor heavy chain 1 [Source:HGNC Symbol%3BAcc:HGNC:6166];gene_id=ENSG00000055957;havana_gene=OTTHUMG00000150312;havana_version=9;logic_name=ensembl_havana_gene;version=10
## [7] ID=gene:ENSG00000258781;Name=RP11-496I2.4;biotype=unprocessed_pseudogene;gene_id=ENSG00000258781;havana_gene=OTTHUMG00000170502;havana_version=2;logic_name=havana;version=2
## [8] ID=gene:ENSG00000157965;Name=SSX8;biotype=unprocessed_pseudogene;description=SSX family member 8 [Source:HGNC Symbol%3BAcc:HGNC:19654];gene_id=ENSG00000157965;havana_gene=OTTHUMG00000021573;havana_version=4;logic_name=havana;version=11
## [9] ID=gene:ENSG00000273489;Name=RP11-180C16.1;biotype=antisense;gene_id=ENSG00000273489;havana_gene=OTTHUMG00000186336;havana_version=1;logic_name=havana;version=1
## [10] ID=gene:ENSG00000279532;Name=CTB-96E2.6;biotype=TEC;gene_id=ENSG00000279532;havana_gene=OTTHUMG00000179414;havana_version=1;logic_name=havana;version=1
## 1623077 Levels: external_name=Ala;logic_name=trnascan ...
dim(ndf)
## [1] 42470 9
- extracting gene information from attributes field
I don’t know if there is an easier way in Python but in R we don’t need to create big helper functions around it. We can simply use “gsub()” with defining the regular expression for what we want to extract. This makes the R code much shorter and easier to understand! We then drop the original “attributes” column.
To have a look at the dataframe, we use “head()” this time.
Python:
import re
RE_GENE_NAME = re.compile(r'Name=(?P<gene_name>.+?);')
def extract_gene_name(attributes_str):
res = RE_GENE_NAME.search(attributes_str)
return res.group('gene_name')
ndf['gene_name'] = ndf.attributes.apply(extract_gene_name)
RE_GENE_ID = re.compile(r'gene_id=(?P<gene_id>ENSG.+?);')
def extract_gene_id(attributes_str):
res = RE_GENE_ID.search(attributes_str)
return res.group('gene_id')
ndf['gene_id'] = ndf.attributes.apply(extract_gene_id)
RE_DESC = re.compile('description=(?P<desc>.+?);')
def extract_description(attributes_str):
res = RE_DESC.search(attributes_str)
if res is None:
return ''
else:
return res.group('desc')
ndf['desc'] = ndf.attributes.apply(extract_description)
ndf.drop('attributes', axis=1, inplace=True)
ndf.head()
R:
ndf$gene_name <- gsub("(.*Name=)(.*?)(;biotype.*)", "\\2", ndf$attributes)
ndf$gene_id <- gsub("(ID=gene:)(.*?)(;Name.*)", "\\2", ndf$attributes)
ndf$desc <- gsub("(.*description=)(.*?)(;.*)", "\\2", ndf$attributes)
# some genes don't have a description
ndf$desc <- ifelse(grepl("^ID=.*", ndf$desc), "", ndf$desc)
ndf <- subset(ndf, select = -attributes)
head(ndf)
## seqid source type start end score strand phase gene_name
## 17 1 havana gene 11869 14409 . + . DDX11L1
## 29 1 havana gene 14404 29570 . - . WASH7P
## 72 1 havana gene 52473 53312 . + . OR4G4P
## 75 1 havana gene 62948 63887 . + . OR4G11P
## 78 1 ensembl_havana gene 69091 70008 . + . OR4F5
## 109 1 havana gene<PHONE_NUMBER>36 . + . CICP27
## gene_id
## 17 ENSG00000223972
## 29 ENSG00000227232
## 72 ENSG00000268020
## 75 ENSG00000240361
## 78 ENSG00000186092
## 109 ENSG00000233750
## desc
## 17 DEAD/H-box helicase 11 like 1 [Source:HGNC Symbol%3BAcc:HGNC:37102]
## 29 WAS protein family homolog 7 pseudogene [Source:HGNC Symbol%3BAcc:HGNC:38034]
## 72 olfactory receptor family 4 subfamily G member 4 pseudogene [Source:HGNC Symbol%3BAcc:HGNC:14822]
## 75 olfactory receptor family 4 subfamily G member 11 pseudogene [Source:HGNC Symbol%3BAcc:HGNC:31276]
## 78 olfactory receptor family 4 subfamily F member 5 [Source:HGNC Symbol%3BAcc:HGNC:14825]
## 109 capicua transcriptional repressor pseudogene 27 [Source:HGNC Symbol%3BAcc:HGNC:48835]
Next, we want to know how many unique gene names and gene IDs there are. As above we use the “unique()”, “shape()” (Python) and “length()” (R) functions.
The count table for gene names can again be obtained with R’s “table()” function, even though Zhuyi Xue uses a slightly different approach: he first groups the “gene_name” column, then counts and sorts.
Finally, we can calculate the proportion of genes that have more than appear more than once and we can have a closer look at the SCARNA20 gene.
Python:
ndf.shape
ndf.gene_id.unique().shape
ndf.gene_name.unique().shape
count_df = ndf.groupby('gene_name').count().ix[:, 0].sort_values().ix[::-1]
count_df.head(10)
count_df[count_df > 1].shape
count_df.shape
count_df[count_df > 1].shape[0] / count_df.shape[0]
ndf[ndf.gene_name == 'SCARNA20']
R:
dim(ndf)
## [1] 42470 11
length(unique(ndf$gene_id))
## [1] 42470
length(unique(ndf$gene_name))
## [1] 42387
count_df <- sort(table(ndf$gene_name), decreasing = TRUE)
head(count_df, n = 10)
##
## SCARNA20 SCARNA16 SCARNA17 SCARNA11
## 7 6 5 4
## SCARNA15 SCARNA21 Clostridiales-1 SCARNA4
## 4 4 3 3
## ACTR3BP2 AGBL1
## 2 2
length(count_df[count_df > 1])
## [1] 63
length(count_df)
## [1] 42387
length(count_df[count_df > 1]) / length(count_df)
## [1] 0.001486305
ndf[ndf$gene_name == "SCARNA20", ]
## seqid source type start end score strand phase
## 179400 1 ensembl gene 171768070 171768175 . + .
## 201038 1 ensembl gene 204727991 204728106 . + .
## 349204 11 ensembl gene 8555016 8555146 . + .
## 718521 14 ensembl gene 63479272 63479413 . + .
## 837234 15 ensembl gene 75121536 75121666 . - .
## 1039875 17 ensembl gene 28018770 28018907 . + .
## 1108216 17 ensembl gene 60231516 60231646 . - .
## gene_name gene_id
## 179400 SCARNA20 ENSG00000253060
## 201038 SCARNA20 ENSG00000251861
## 349204 SCARNA20 ENSG00000252778
## 718521 SCARNA20 ENSG00000252800
## 837234 SCARNA20 ENSG00000252722
## 1039875 SCARNA20 ENSG00000251818
## 1108216 SCARNA20 ENSG00000252577
## desc
## 179400 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 201038 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 349204 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 718521 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 837234 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 1039875 Small Cajal body specific RNA 20 [Source:RFAM%3BAcc:RF00601]
## 1108216 small Cajal body-specific RNA 20 [Source:HGNC Symbol%3BAcc:HGNC:32578]
# dplyr:
# ndf %>% filter(gene_name == "SCARNA20")
How Long Is a Typical Gene?
To calculate gene lengths we use the same code as before. R’s summary() is not exactly the same as Python’s describe() but it’s close enough.
Python:
ndf['length'] = ndf.end - ndf.start + 1
ndf.length.describe()
R:
ndf$length <- ndf$end - ndf$start + 1
summary(ndf$length)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 8 884 5170 35830 30550 2305000
Now we produce the first plot, showing a histogram of gene length. In base R you can’t really plot a histogram with logarithmic y-axis scales (at least not without manually tweaking the hist() output but it isn’t recommended anyway because 0 will become -Inf). But we can do it easily with ggplot2 with “scale_y_log10()”. The code we need for ggplot2 is a bit longer than with matplotlib. We could of course further customize our plot but for now, let’s keep it simple.
Python:
import matplotlib as plt
ndf.length.plot(kind='hist', bins=50, logy=True)
plt.show()
R:
ndf %>% ggplot(aes(x = length)) +
geom_histogram(bins = 50, fill = "blue") +
scale_y_log10()
Now, we subset the dataframe to keep only rows where the “length” column contains values bigger than 2 million and order it by descending gene length. To see the shortest genes, we order the original dataframe and view the first 6 rows. Instead of “sort()”, we use dplyr’s “arrange()” function this time (I didn’t use it before because it can only be applied to dataframes).
Python:
ndf[ndf.length > 2e6].sort_values('length').ix[::-1]
ndf.sort_values('length').head()
R:
ndf %>% filter(length > 2e6) %>% arrange(desc(length))
## seqid source type start end score strand phase
## 1 7 ensembl_havana gene 146116002 148420998 . + .
## 2 9 ensembl_havana gene 8314246 10612723 . - .
## 3 X ensembl_havana gene 31097677 33339441 . - .
## 4 11 ensembl_havana gene 83455012 85627922 . - .
## 5 8 ensembl_havana gene 2935353 4994972 . - .
## 6 20 ensembl_havana gene 13995369 16053197 . + .
## gene_name gene_id
## 1 CNTNAP2 ENSG00000174469
## 2 PTPRD ENSG00000153707
## 3 DMD ENSG00000198947
## 4 DLG2 ENSG00000150672
## 5 CSMD1 ENSG00000183117
## 6 MACROD2 ENSG00000172264
## desc
## 1 contactin associated protein-like 2 [Source:HGNC Symbol%3BAcc:HGNC:13830]
## 2 protein tyrosine phosphatase%2C receptor type D [Source:HGNC Symbol%3BAcc:HGNC:9668]
## 3 dystrophin [Source:HGNC Symbol%3BAcc:HGNC:2928]
## 4 discs large MAGUK scaffold protein 2 [Source:HGNC Symbol%3BAcc:HGNC:2901]
## 5 CUB and Sushi multiple domains 1 [Source:HGNC Symbol%3BAcc:HGNC:14026]
## 6 MACRO domain containing 2 [Source:HGNC Symbol%3BAcc:HGNC:16126]
## length
## 1 2304997
## 2 2298478
## 3 2241765
## 4 2172911
## 5 2059620
## 6 2057829
head(arrange(ndf, length))
## seqid source type start end score strand phase gene_name
## 1 14 havana gene 22438547 22438554 . + . TRDD1
## 2 14 havana gene 22439007 22439015 . + . TRDD2
## 3 7 havana gene 142786213 142786224 . + . TRBD1
## 4 14 havana gene 22449113 22449125 . + . TRDD3
## 5 4 havana gene 10238213 10238235 . - . AC006499.9
## 6 3 havana gene 179452395 179452419 . - . RP11-145M9.2
## gene_id
## 1 ENSG00000223997
## 2 ENSG00000237235
## 3 ENSG00000282431
## 4 ENSG00000228985
## 5 ENSG00000271544
## 6 ENSG00000239255
## desc
## 1 T cell receptor delta diversity 1 [Source:HGNC Symbol%3BAcc:HGNC:12254]
## 2 T cell receptor delta diversity 2 [Source:HGNC Symbol%3BAcc:HGNC:12255]
## 3 T cell receptor beta diversity 1 [Source:HGNC Symbol%3BAcc:HGNC:12158]
## 4 T cell receptor delta diversity 3 [Source:HGNC Symbol%3BAcc:HGNC:12256]
## 5
## 6
## length
## 1 8
## 2 9
## 3 12
## 4 13
## 5 23
## 6 25
Gene Distribution Among Chromosomes
The number of genes per chromosome are counted with the “subset()”, “table()” and “sort()” functions as described earlier.
Python:
ndf = ndf[ndf.seqid.isin(chrs)]
chr_gene_counts = ndf.groupby('seqid').count().ix[:, 0].sort_values().ix[::-1]
chr_gene_counts
R:
ndf$seqid <- as.character(ndf$seqid) # as factors it will subset the dataframe but keep the factor levels
ndf <- subset(ndf, seqid %in% chrs)
chr_gene_counts <- sort(table(ndf$seqid), decreasing = TRUE)
chr_gene_counts
##
## 1 2 11 19 17 3 6 12 7 5 16 X 4 9 8
## 3902 2806 2561 2412 2280 2204 2154 2140 2106 2002 1881 1852 1751 1659 1628
## 10 15 14 22 20 13 18 21 Y
## 1600 1476 1449 996 965 872 766 541 436
To see all genes that are on mitochondrial chromosome, we subset the first dataframe by two conditions. In both, R and Python this is done with the ampersand symbol but in R we don’t need brackets around the individual conditions.
Python:
df[(df.type == 'gene') & (df.seqid == 'MT')]
R:
subset(df, type == "gene" & seqid == "MT")
## seqid source type start end score strand phase
## 2514004 MT insdc gene 648 1601 . + .
## 2514010 MT insdc gene 1671 3229 . + .
## 2514017 MT insdc gene 3307 4262 . + .
## 2514030 MT insdc gene 4470 5511 . + .
## 2514049 MT insdc gene 5904 7445 . + .
## 2514059 MT insdc gene 7586 8269 . + .
## 2514066 MT insdc gene 8366 8572 . + .
## 2514070 MT insdc gene 8527 9207 . + .
## 2514074 MT insdc gene 9207 9990 . + .
## 2514081 MT insdc gene 10059 10404 . + .
## 2514088 MT insdc gene 10470 10766 . + .
## 2514092 MT insdc gene 10760 12137 . + .
## 2514105 MT insdc gene 12337 14148 . + .
## 2514109 MT insdc gene 14149 14673 . - .
## 2514116 MT insdc gene 14747 15887 . + .
## attributes
## 2514004 ID=gene:ENSG00000211459;Name=MT-RNR1;biotype=Mt_rRNA;description=mitochondrially encoded 12S RNA [Source:HGNC Symbol%3BAcc:HGNC:7470];gene_id=ENSG00000211459;logic_name=mt_genbank_import;version=2
## 2514010 ID=gene:ENSG00000210082;Name=MT-RNR2;biotype=Mt_rRNA;description=mitochondrially encoded 16S RNA [Source:HGNC Symbol%3BAcc:HGNC:7471];gene_id=ENSG00000210082;logic_name=mt_genbank_import;version=2
## 2514017 ID=gene:ENSG00000198888;Name=MT-ND1;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 1 [Source:HGNC Symbol%3BAcc:HGNC:7455];gene_id=ENSG00000198888;logic_name=mt_genbank_import;version=2
## 2514030 ID=gene:ENSG00000198763;Name=MT-ND2;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 2 [Source:HGNC Symbol%3BAcc:HGNC:7456];gene_id=ENSG00000198763;logic_name=mt_genbank_import;version=3
## 2514049 ID=gene:ENSG00000198804;Name=MT-CO1;biotype=protein_coding;description=mitochondrially encoded cytochrome c oxidase I [Source:HGNC Symbol%3BAcc:HGNC:7419];gene_id=ENSG00000198804;logic_name=mt_genbank_import;version=2
## 2514059 ID=gene:ENSG00000198712;Name=MT-CO2;biotype=protein_coding;description=mitochondrially encoded cytochrome c oxidase II [Source:HGNC Symbol%3BAcc:HGNC:7421];gene_id=ENSG00000198712;logic_name=mt_genbank_import;version=1
## 2514066 ID=gene:ENSG00000228253;Name=MT-ATP8;biotype=protein_coding;description=mitochondrially encoded ATP synthase 8 [Source:HGNC Symbol%3BAcc:HGNC:7415];gene_id=ENSG00000228253;logic_name=mt_genbank_import;version=1
## 2514070 ID=gene:ENSG00000198899;Name=MT-ATP6;biotype=protein_coding;description=mitochondrially encoded ATP synthase 6 [Source:HGNC Symbol%3BAcc:HGNC:7414];gene_id=ENSG00000198899;logic_name=mt_genbank_import;version=2
## 2514074 ID=gene:ENSG00000198938;Name=MT-CO3;biotype=protein_coding;description=mitochondrially encoded cytochrome c oxidase III [Source:HGNC Symbol%3BAcc:HGNC:7422];gene_id=ENSG00000198938;logic_name=mt_genbank_import;version=2
## 2514081 ID=gene:ENSG00000198840;Name=MT-ND3;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 3 [Source:HGNC Symbol%3BAcc:HGNC:7458];gene_id=ENSG00000198840;logic_name=mt_genbank_import;version=2
## 2514088 ID=gene:ENSG00000212907;Name=MT-ND4L;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 4L [Source:HGNC Symbol%3BAcc:HGNC:7460];gene_id=ENSG00000212907;logic_name=mt_genbank_import;version=2
## 2514092 ID=gene:ENSG00000198886;Name=MT-ND4;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 4 [Source:HGNC Symbol%3BAcc:HGNC:7459];gene_id=ENSG00000198886;logic_name=mt_genbank_import;version=2
## 2514105 ID=gene:ENSG00000198786;Name=MT-ND5;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 5 [Source:HGNC Symbol%3BAcc:HGNC:7461];gene_id=ENSG00000198786;logic_name=mt_genbank_import;version=2
## 2514109 ID=gene:ENSG00000198695;Name=MT-ND6;biotype=protein_coding;description=mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 6 [Source:HGNC Symbol%3BAcc:HGNC:7462];gene_id=ENSG00000198695;logic_name=mt_genbank_import;version=2
## 2514116 ID=gene:ENSG00000198727;Name=MT-CYB;biotype=protein_coding;description=mitochondrially encoded cytochrome b [Source:HGNC Symbol%3BAcc:HGNC:7427];gene_id=ENSG00000198727;logic_name=mt_genbank_import;version=2
We can get the chromosome lengths from the dataframe as well. We again subset to only the main chromosomes, then drop unwanted columns and order by length.
Python:
gdf = gdf[gdf.seqid.isin(chrs)]
gdf.drop(['start', 'end', 'score', 'strand', 'phase' ,'attributes'], axis=1, inplace=True)
gdf.sort_values('length').ix[::-1]
R:
gdf$seqid <- as.character(gdf$seqid) # as factors it will subset the dataframe but keep the factor levels
gdf <- subset(gdf, as.character(seqid) %in% chrs) %>%
select(-(start:attributes))
arrange(gdf, desc(length))
## seqid source type length
## 1 1 GRCh38 chromosome 248956422
## 2 2 GRCh38 chromosome 242193529
## 3 3 GRCh38 chromosome 198295559
## 4 4 GRCh38 chromosome 190214555
## 5 5 GRCh38 chromosome 181538259
## 6 6 GRCh38 chromosome 170805979
## 7 7 GRCh38 chromosome 159345973
## 8 X GRCh38 chromosome 156040895
## 9 8 GRCh38 chromosome 145138636
## 10 9 GRCh38 chromosome 138394717
## 11 11 GRCh38 chromosome 135086622
## 12 10 GRCh38 chromosome 133797422
## 13 12 GRCh38 chromosome 133275309
## 14 13 GRCh38 chromosome 114364328
## 15 14 GRCh38 chromosome 107043718
## 16 15 GRCh38 chromosome 101991189
## 17 16 GRCh38 chromosome 90338345
## 18 17 GRCh38 chromosome 83257441
## 19 18 GRCh38 chromosome 80373285
## 20 20 GRCh38 chromosome 64444167
## 21 19 GRCh38 chromosome 58617616
## 22 Y GRCh38 chromosome 54106423
## 23 22 GRCh38 chromosome 50818468
## 24 21 GRCh38 chromosome 46709983
## 25 MT GRCh38 chromosome 16569
Now, we merge the dataframe with the number of genes per chromosome with the dataframe of chromosome lengths. Because R’s “table()” function produces a vector, we need to convert it to a dataframe first and define the column names. Then, we use the “merge()” function and point to the name of the column we want to merge by.
Python:
cdf = chr_gene_counts.to_frame(name='gene_count').reset_index()
cdf.head(2)
merged = gdf.merge(cdf, on='seqid')
R:
cdf <- as.data.frame(chr_gene_counts)
colnames(cdf) <- c("seqid", "gene_count")
head(cdf, n = 2)
## seqid gene_count
## 1 1 3902
## 2 2 2806
merged <- merge(gdf, cdf, by = "seqid")
merged
## seqid source type length gene_count
## 1 1 GRCh38 chromosome 248956422 3902
## 2 10 GRCh38 chromosome 133797422 1600
## 3 11 GRCh38 chromosome 135086622 2561
## 4 12 GRCh38 chromosome 133275309 2140
## 5 13 GRCh38 chromosome 114364328 872
## 6 14 GRCh38 chromosome 107043718 1449
## 7 15 GRCh38 chromosome 101991189 1476
## 8 16 GRCh38 chromosome 90338345 1881
## 9 17 GRCh38 chromosome 83257441 2280
## 10 18 GRCh38 chromosome 80373285 766
## 11 19 GRCh38 chromosome 58617616 2412
## 12 2 GRCh38 chromosome 242193529 2806
## 13 20 GRCh38 chromosome 64444167 965
## 14 21 GRCh38 chromosome 46709983 541
## 15 22 GRCh38 chromosome 50818468 996
## 16 3 GRCh38 chromosome 198295559 2204
## 17 4 GRCh38 chromosome 190214555 1751
## 18 5 GRCh38 chromosome 181538259 2002
## 19 6 GRCh38 chromosome 170805979 2154
## 20 7 GRCh38 chromosome 159345973 2106
## 21 8 GRCh38 chromosome 145138636 1628
## 22 9 GRCh38 chromosome 138394717 1659
## 23 X GRCh38 chromosome 156040895 1852
## 24 Y GRCh38 chromosome 54106423 436
To calculate the correlation between length and gene count, we subset the merged dataframe to those two columns and use the “corr()” (Python) or “cor()” (R) function.
Python:
merged[['length', 'gene_count']].corr()
R:
cor(merged[, c("length", "gene_count")])
## length gene_count
## length 1.0000000 0.7282208
## gene_count 0.7282208 1.0000000
And now we produce the final plot: a line plot of chromosome length by number of genes per chromosome. For Python, we again use the matplotlib and for R the ggplot2 packages. Because Zhuyi Xue creates a new dataframe and tweaks the plot somewhat, our ggplot2 code is simpler and tidier here.
Python:
ax = merged[['length', 'gene_count']].sort_values('length').plot(x='length', y='gene_count', style='o-')
# add some margin to both ends of x axis
xlim = ax.get_xlim()
margin = xlim[0] * 0.1
ax.set_xlim([xlim[0] - margin, xlim[1] + margin])
# Label each point on the graph
for (s, x, y) in merged[['seqid', 'length', 'gene_count']].sort_values('length').values:
ax.text(x, y - 100, str(s))
R:
merged[, c("seqid", "length", "gene_count")] %>%
arrange(desc(length)) %>%
ggplot(aes(x = length, y = gene_count, label = seqid)) +
geom_point(color = "blue") +
geom_line(color = "blue") +
geom_text()
## R version 3.3.2 (2016-10-31)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: macOS Sierra 10.12.1
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_2.2.1 dplyr_0.5.0
##
## loaded via a namespace (and not attached):
## [1] Rcpp_0.12.8 codetools_0.2-15 digest_0.6.11 rprojroot_1.1
## [5] assertthat_0.1 plyr_1.8.4 grid_3.3.2 R6_2.2.0
## [9] gtable_0.2.0 DBI_0.5-1 backports_1.0.4 magrittr_1.5
## [13] scales_0.4.1 evaluate_0.10 stringi_1.1.2 lazyeval_0.2.0
## [17] rmarkdown_1.3 labeling_0.3 tools_3.3.2 stringr_1.1.0
## [21] munsell_0.4.3 yaml_2.1.14 colorspace_1.3-2 htmltools_0.3.5
## [25] knitr_1.15.1 tibble_1.2


Neutrino Script
Like C for Javascript
About
Neutrino script is a subset of javascript designed to allow low level memory management, shortcodes, defines, and more. See our website at http://neutrinoscript.com/ for more detailed documentation.
The syntax is fresh yet similar to javascript while providing extra abstraction layers to allow more logical code production. This means a script written in Neutrino script can be converted into javascript as it is converted into javascript during the complation process.
Supported Javascript
Currently Neutrino script is designed to run under EMCAScript 5 equivalent javascript syntax only.
Installing
Using npm on your command prompt / terminal run the following commands:
npm install -g neutrino
npm install -g neutrino-memory
Getting Started
See our documentation on our website http://neutrinoscript.com/ for examples of how to write neutrinoscript .neu files.
Converting NeutrinoScript to Javascript
neutrino convert /path/to/your/script.neu /output/path/script.js
Running via NodeJS
neutrino /path/to/your/script.neu
Running in the Browser
Please see the documentation on how to use the provided build/neutrino.js file on the web.
** Changes from 1.0.1 to 1.1.0 introduce a new way to load neutrino script via the web.
Simply replace:
window.neutrino.web(document);
with
var neutrino = require('neutrino');
neutrino.web(document);
License
Neutrino script is licensed under the MIT license


--- title: Everyday Python - New Blog date: 2013-01-13 comments: true layout: post categories: - python ref_url: ---
I've decided that it will be best to keep my personal blog separate from the new Everyday Python blog project. All of the infrastructure to make the posts interactive just work so much better when I have control of the server and everything else. So You can head over to Everyday Python and click on the Everyday Python link there, or if you want to subscribe to the RSS feed for that project you can use this link.


Micronaut Framework
Compilation limits
Presentation by
Ryszard Perkowski
About me
Using Spring since 2006
Agenda
Problem
Solution
API Overview
Benchmarks and other lies
QA
Oracle Code One 2018
Why?
a lot happens in runtime
Read the byte code of every bean it finds
Synthesize new annotations
Build Reflective Metadata
Other problems
Type erasure
Slow reflection
Reflective data caches
Classpath scanning
Dynamic class loading
Let me demon-strate
Spring Boot petclinic
On top of it
https://blog.tenx.tech/the-nix-fix-f4844773d281
AWS
IO
CPU
Network
Cloud cost
https://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud
What can you do?
buy a bigger mac
don't worry, pay more
buy Amazon shares
do less
Oracle Code One 2018
Solution - potential
Ahead of time compilation
Google Dagger 2.x
Java server world
Goal
Create a New Framework designed from the groundup for Microservices and Serverless Computing
Blazing fast startup time
Low Memory Footprint
As Small As Possible JAR Sizes
Zero Dependency
12 Factor - https://12factor.net
How
DI during compilation
Reactive - based on Netty
AOP, proxies all processed during compilation
How small
Oracle Code One 2018
API
Demo
API Functions
AWS Lambda
Other benefits
Better tooling integration (Jackson)
Auto Documentation
GraalVM
GraalVM
GraalVM Native image
20ms startup with 18MB consumption
https://medium.com/graalvm/lightweight-cloud-native-java-applications-35d56bc45673
GraalVM requirements
plan ahead
Benchmarks
Benchmark
Our results
Project size - medium - ~ 300 classes with logic
Jar size - 150MB -> 42MB
Startup - 8s - 2s
Our issues
HTTP status 499
Our issues
Competition
Quarkus
Helidon
Future looks bright
ORM
reflection-free validation-api
OAuth2
JMS
Summary
Micronaut is small and fast
has many Spring features
allows for a lot of new features
Q & A


The click event occurred unknown milliseconds after January 1, 1970.
The click event occurred unknown seconds after January 1, 1970.
The click event occurred unknown minutes after January 1, 1970.
The click event occurred unknown hours after January 1, 1970.


Vitalpointz IOT Core Lite is a cloud native, built from ground up, microservice based IoT Platform. The software provides necessary security features to IoT Devices along with following features
2 Core CPU
4GB RAM
80 GB Storage
1024 free licenses bundled. Additional licenses can be added.
Digital Ocean’s marketplace
https://m.do.co/c/af19e6df9ca6
May.18, 2019
Message I/O:3072 messages per minute using MQTT over TLS
Device On-Boarding: 24devices per minute
vitalpointz is a software maker that specializes on developing and offering IOT platform softwares & services. IOT Devices and sensors can be registered on the IOT Platform and on-boarded securely. IOT devices can send or receive data securely, application can be built, Over-the Air software updates can be rolled out to the devices at scale. Vitalpointz IOT Platform also provides various interface methods to transfer the data to external third-party tools and platforms, if so desired. Vitalpointz IOT Platform also bundles various device agents.
For more information about our product please check our product documentation here.
If you have any enquires, reach out to us via email : info@vitalpointz.net


!= include('style') ?>
Submitting...
To subscribe to the Professional Development Calendar, copy the following link:
Paste the link into your Google Calendar to subscribe.
Close Window
= Session.getActiveUser().getEmail(); ?>
To register for a workshop, fill in your name information and then click on the button next to each session title. Click Register when you're finished.


Lecture 31
Qi Wang, Department of Statistics
Nov 5, 2018
If we have independent Normal random variables, then the sum(or other linear combination) of these Normal random variables is ALSO Normal
If $X_1 \sim N(\mu_1, \sigma_1), X_2 \sim N(\mu_2, \sigma_2), \cdots, X_n \sim N(\mu_n, \sigma_n)$, and $X = \sum_{i=1}^n X_i$, then
Let $X_1, X_2$ and $X_3$ be independent Normal random variables, where $$X_1 \sim N(\mu = 4, \sigma = 2), X_2 \sim N(\mu = 3.1, \sigma = 7), X_3 \sim N(\mu = 1.5, \sigma = 1.4)$$
If a Binomial distribution has a large enough combination of n and p, it behaves much like a Normal distribution, which means we can use the Normal distribution to approximate the original Binomial distribution
You may notice that Binomial is Discrete, and Normal is Continuous. This means the approximation comes at a cost of accuracy that we must try to correct. When we use the approximation, we need to perform a continuity correction:
If all conditions are satistified, find the Normal approximation to the following probability statement where $X$ follows a Binomial distribution
A class has 400 students, and each drops the course independently with probability 0.07. Let X be the number of students that finish the course


In finance and economics filed, most of the models are linear ones. We can see linear regression everywhere, from the foundation of the model portfolio theory to the nowadays popular Fama-French asset pricing model. It's very important to understand how linear regression works in order to have a comprehensive understanding of those theories.
If we are holding a stock, we must be curious about the relationship between our stock return and the market return. Let's say we hold Amazon stock on the first day of this year. In order to see the relation directly, we plot the daily return of our stock on the y-axis and plot the S&P 500 index daily return on the x-axis.
import numpy as np import pandas as pd import quandl quandl.ApiConfig.api_key = '_fgkxjSbt5389zGt4crC' #get data from quandl spy_table = quandl.get('BCIW/_SPXT') amzn_table = quandl.get('WIKI/AMZN') #fetch data from Jan 2017 to Jun 2017 spy = spy_table.loc['2017':'2017-6',['Close']] amzn = amzn_table.loc['2017':'2017-6',['Close']] #calculate log return spy_log = np.log(spy.Close).diff().dropna() amzn_log = np.log(amzn.Close).diff().dropna() df = pd.concat([spy_log,amzn_log],axis = 1).dropna() df.columns = ['spx','amzn'] print df.tail()
| spy | amzn | |
| 2016-12-22 | -0.004462 | -0.005543 |
| 2016-12-23 | 0.001372 | -0.007531 |
| 2016-12-23 | 0.000928 | 0.000946 |
| 2016-12-23 | -0.005671 | -0.009081 |
| 2016-12-23 | 0.002086 | -0.020172 |
We successfully create a DataFrame contains the daily logarithm return of Amazon stock and S&P500. Now let's plot it:
import matplotlib.pyplot as plt plt.figure(figsize = (15,10)) plt.scatter(df.spy,df.amzn) plt.show()
The plot is scattered, but we can see they are approximately correlated: generally the higher SPX's daily return is, the higher Amazon stock's return is. This is called positively correlated. We will cover it in the following tutorials.


public static class Calendar.Builder extends Object
Calendar.Builder
is used for creating a Calendar
from
various date-time parameters.
There are two ways to set a Calendar
to a date-time value. One
is to set the instant parameter to a millisecond offset from the Epoch. The other is to set individual
field parameters, such as YEAR
, to their desired
values. These two ways can't be mixed. Trying to set both the instant and
individual fields will cause an IllegalStateException
to be
thrown. However, it is permitted to override previous values of the
instant or field parameters.
If no enough field parameters are given for determining date and/or
time, calendar specific default values are used when building a
Calendar
. For example, if the YEAR
value
isn't given for the Gregorian calendar, 1970 will be used. If there are
any conflicts among field parameters, the resolution rules are applied.
Therefore, the order of field setting matters.
In addition to the date-time parameters, the locale, time zone, week definition, and leniency mode parameters can be set.
Examples
The following are sample usages. Sample code assumes that the
Calendar
constants are statically imported.
The following code produces a Calendar
with date 2012-12-31
(Gregorian) because Monday is the first day of a week with the ISO 8601
compatible week parameters.
Calendar cal = new Calendar.Builder().setCalendarType("iso8601") .setWeekDate(2013, 1, MONDAY).build();
The following code produces a Japanese Calendar
with date
1989-01-08 (Gregorian), assuming that the default ERA
is Heisei that started on that day.
Calendar cal = new Calendar.Builder().setCalendarType("japanese") .setFields(YEAR, 1, DAY_OF_YEAR, 1).build();
Calendar.getInstance(TimeZone, Locale)
,
Calendar.fields
| Constructor and Description |
|---|
Builder()
Constructs a
Calendar.Builder . |
| Modifier and Type | Method and Description |
|---|---|
Calendar |
build()
Returns a
Calendar built from the parameters set by the
setter methods. |
Calendar.Builder |
set(int field,
int value)
Sets the
field parameter to the given value . |
Calendar.Builder |
setCalendarType(String type)
Sets the calendar type parameter to the given
type . |
Calendar.Builder |
setDate(int year,
int month,
int dayOfMonth)
Sets the date field parameters to the values given by
year ,
month , and dayOfMonth . |
Calendar.Builder |
setFields(int... fieldValuePairs)
Sets field parameters to their values given by
fieldValuePairs that are pairs of a field and its value. |
Calendar.Builder |
setInstant(Date instant)
Sets the instant parameter to the
instant value given by a
Date . |
Calendar.Builder |
setInstant(long instant)
Sets the instant parameter to the given
instant value that is
a millisecond offset from the
Epoch. |
Calendar.Builder |
setLenient(boolean lenient)
Sets the lenient mode parameter to the value given by
lenient . |
Calendar.Builder |
setLocale(Locale locale)
Sets the locale parameter to the given
locale . |
Calendar.Builder |
setTimeOfDay(int hourOfDay,
int minute,
int second)
Sets the time of day field parameters to the values given by
hourOfDay , minute , and second . |
Calendar.Builder |
setTimeOfDay(int hourOfDay,
int minute,
int second,
int millis)
Sets the time of day field parameters to the values given by
hourOfDay , minute , second , and
millis . |
Calendar.Builder |
setTimeZone(TimeZone zone)
Sets the time zone parameter to the given
zone . |
Calendar.Builder |
setWeekDate(int weekYear,
int weekOfYear,
int dayOfWeek)
Sets the week-based date parameters to the values with the given
date specifiers - week year, week of year, and day of week.
|
Calendar.Builder |
setWeekDefinition(int firstDayOfWeek,
int minimalDaysInFirstWeek)
Sets the week definition parameters to the values given by
firstDayOfWeek and minimalDaysInFirstWeek that are
used to determine the first
week of a year. |
public Calendar.Builder setInstant(long instant)
instant
value that is
a millisecond offset from the
Epoch.instant
- a millisecond offset from the EpochCalendar.Builder
IllegalStateException
- if any of the field parameters have
already been setCalendar.setTime(Date)
,
Calendar.setTimeInMillis(long)
,
Calendar.time
public Calendar.Builder setInstant(Date instant)
instant
value given by a
Date
. This method is equivalent to a call to
setInstant(instant.getTime())
.instant
- a Date
representing a millisecond offset from
the EpochCalendar.Builder
NullPointerException
- if instant
is null
IllegalStateException
- if any of the field parameters have
already been setCalendar.setTime(Date)
,
Calendar.setTimeInMillis(long)
,
Calendar.time
public Calendar.Builder set(int field, int value)
field
parameter to the given value
.
field
is an index to the Calendar.fields
, such as
DAY_OF_MONTH
. Field value validation is
not performed in this method. Any out of range values are either
normalized in lenient mode or detected as an invalid value in
non-lenient mode when building a Calendar
.field
- an index to the Calendar
fieldsvalue
- the field valueCalendar.Builder
IllegalArgumentException
- if field
is invalidIllegalStateException
- if the instant value has already been set,
or if fields have been set too many
(approximately Integer.MAX_VALUE
) times.Calendar.set(int, int)
public Calendar.Builder setFields(int... fieldValuePairs)
fieldValuePairs
that are pairs of a field and its value.
For example,
setFeilds(Calendar.YEAR, 2013, Calendar.MONTH, Calendar.DECEMBER, Calendar.DAY_OF_MONTH, 23);is equivalent to the sequence of the following
set
calls:
set(Calendar.YEAR, 2013) .set(Calendar.MONTH, Calendar.DECEMBER) .set(Calendar.DAY_OF_MONTH, 23);
fieldValuePairs
- field-value pairsCalendar.Builder
NullPointerException
- if fieldValuePairs
is null
IllegalArgumentException
- if any of fields are invalid,
or if fieldValuePairs.length
is an odd number.IllegalStateException
- if the instant value has been set,
or if fields have been set too many (approximately
Integer.MAX_VALUE
) times.public Calendar.Builder setDate(int year, int month, int dayOfMonth)
year
,
month
, and dayOfMonth
. This method is equivalent to
a call to:
setFields(Calendar.YEAR, year, Calendar.MONTH, month, Calendar.DAY_OF_MONTH, dayOfMonth);
year
- the YEAR
valuemonth
- the MONTH
value
(the month numbering is 0-based).dayOfMonth
- the DAY_OF_MONTH
valueCalendar.Builder
public Calendar.Builder setTimeOfDay(int hourOfDay, int minute, int second)
hourOfDay
, minute
, and second
. This method is
equivalent to a call to:
setTimeOfDay(hourOfDay, minute, second, 0);
hourOfDay
- the HOUR_OF_DAY
value
(24-hour clock)minute
- the MINUTE
valuesecond
- the SECOND
valueCalendar.Builder
public Calendar.Builder setTimeOfDay(int hourOfDay, int minute, int second, int millis)
hourOfDay
, minute
, second
, and
millis
. This method is equivalent to a call to:
setFields(Calendar.HOUR_OF_DAY, hourOfDay, Calendar.MINUTE, minute, Calendar.SECOND, second, Calendar.MILLISECOND, millis);
hourOfDay
- the HOUR_OF_DAY
value
(24-hour clock)minute
- the MINUTE
valuesecond
- the SECOND
valuemillis
- the MILLISECOND
valueCalendar.Builder
public Calendar.Builder setWeekDate(int weekYear, int weekOfYear, int dayOfWeek)
If the specified calendar doesn't support week dates, the
build
method will throw an IllegalArgumentException
.
weekYear
- the week yearweekOfYear
- the week number based on weekYear
dayOfWeek
- the day of week value: one of the constants
for the DAY_OF_WEEK
field:
SUNDAY
, ..., SATURDAY
.Calendar.Builder
Calendar.setWeekDate(int, int, int)
,
Calendar.isWeekDateSupported()
public Calendar.Builder setTimeZone(TimeZone zone)
zone
. If no time
zone parameter is given to this Caledar.Builder
, the
default
TimeZone
will be used in the build
method.zone
- the TimeZone
Calendar.Builder
NullPointerException
- if zone
is null
Calendar.setTimeZone(TimeZone)
public Calendar.Builder setLenient(boolean lenient)
lenient
.
If no lenient parameter is given to this Calendar.Builder
,
lenient mode will be used in the build
method.lenient
- true
for lenient mode;
false
for non-lenient modeCalendar.Builder
Calendar.setLenient(boolean)
public Calendar.Builder setCalendarType(String type)
type
. The
calendar type given by this method has precedence over any explicit
or implicit calendar type given by the
locale.
In addition to the available calendar types returned by the
Calendar.getAvailableCalendarTypes
method, "gregorian"
and "iso8601"
as aliases of
"gregory"
can be used with this method.
type
- the calendar typeCalendar.Builder
NullPointerException
- if type
is null
IllegalArgumentException
- if type
is unknownIllegalStateException
- if another calendar type has already been setCalendar.getCalendarType()
,
Calendar.getAvailableCalendarTypes()
public Calendar.Builder setLocale(Locale locale)
locale
. If no locale
is given to this Calendar.Builder
, the default Locale
for Locale.Category.FORMAT
will be used.
If no calendar type is explicitly given by a call to the
setCalendarType
method,
the Locale
value is used to determine what type of
Calendar
to be built.
If no week definition parameters are explicitly given by a call to
the setWeekDefinition
method, the
Locale
's default values are used.
locale
- the Locale
Calendar.Builder
NullPointerException
- if locale
is null
Calendar.getInstance(Locale)
public Calendar.Builder setWeekDefinition(int firstDayOfWeek, int minimalDaysInFirstWeek)
firstDayOfWeek
and minimalDaysInFirstWeek
that are
used to determine the first
week of a year. The parameters given by this method have
precedence over the default values given by the
locale.firstDayOfWeek
- the first day of a week; one of
Calendar.SUNDAY
to Calendar.SATURDAY
minimalDaysInFirstWeek
- the minimal number of days in the first
week (1..7)Calendar.Builder
IllegalArgumentException
- if firstDayOfWeek
or
minimalDaysInFirstWeek
is invalidCalendar.getFirstDayOfWeek()
,
Calendar.getMinimalDaysInFirstWeek()
public Calendar build()
Calendar
built from the parameters set by the
setter methods. The calendar type given by the setCalendarType
method or the locale is
used to determine what Calendar
to be created. If no explicit
calendar type is given, the locale's default calendar is created.
If the calendar type is "iso8601"
, the
Gregorian change date
of a GregorianCalendar
is set to Date(Long.MIN_VALUE)
to be the proleptic Gregorian calendar. Its week definition
parameters are also set to be compatible
with the ISO 8601 standard. Note that the
getCalendarType
method of
a GregorianCalendar
created with "iso8601"
returns
"gregory"
.
The default values are used for locale and time zone if these parameters haven't been given explicitly.
Any out of range field values are either normalized in lenient mode or detected as an invalid value in non-lenient mode.
Calendar
built with parameters of this Calendar.Builder
IllegalArgumentException
- if the calendar type is unknown, or
if any invalid field values are given in non-lenient mode, or
if a week date is given for the calendar type that doesn't
support week dates.Calendar.getInstance(TimeZone, Locale)
,
Locale.getDefault(Locale.Category)
,
TimeZone.getDefault()
Dracula Javadoc Sample, Made with Allan Im.


IN$GHT.AI
Home
Blog
About Us
Stock Info
Stock Analysis
Sign in
Sign up
Latest News
Search ticker
Search
Latest news about
[Current Ticker Name]
[Article Title]
[Article Title]
[Article Title]
[Article Title]
Historical stock price
Stock price of company
Chart by TradingView


pips Red=108 White=74
(CorrectAnswer= 0/0, ErrorScore= 0)
One of the key questions that you have to ask yourself when doubling is this: by doubling now are you giving away something that could be used more effectively later? Once you have doubled your opponent you must win the game with your checker play alone, as the cube is no longer available to you. If you decide not to double then you still have the threat of using the cube later, perhaps giving your opponent a much more difficult decision. I call this concept ‘Cube Future Value’ (CFV).
Let’s look at this week’s position from the final of the RAC 32 tournament this week. Black, Peter Bennet, is trailing your columnist (White) 1-3 in a match to 5. For money this is nowhere near a double, White has too much work still to do, but the perceived wisdom at 4-away vs. 2-away is that one should double very aggressively, especially if there is any hint of a gammon in the air. Knowing this Peter doubled and naturally I accepted.
He then rolled one of his worst numbers, 42 and had to hit with 11/5*. I responded with 65 (luckily not 55!). I moved bar/20*/14* and the game and match were both soon over. Let us go back to the double. If Black rolls any 2 or 4 then he cannot point on White and White will have a lot of play as evidenced by the game continuation. But what if Black does point on White and White enters, which he is favourite to do?
Let us give Black a 61, played 11/5*, 6/5 and assume White enters with a 23, played bar/23, 11/8. What about this position? Black now has some very strong threats and although White has a take it is a much more uncomfortable one than in the in the original position. What if Black makes the 5-pt and White fans? Then the position is double and drop but only if Black still has access to the cube. If Black has already doubled, giving up his CFV then, of course, the game will continue, and White will win the game and the match nearly 20% of the time.
In the modern game players are much quicker to double than they were twenty or thirty years ago and, in the main, an aggressive strategy is likely to the correct one. However, you still need to give your opponent a difficult rather than a trivial decision. CFV is a very powerful concept and one that should be applied in many more situations than it is.
In the original position, because the gammon threat is small and because of CFV, Black does much better to hold on to the cube and in fact, by a small margin, XG rates doubling as a blunder.
Let’s look at this week’s position from the final of the RAC 32 tournament this week. Black, Peter Bennet, is trailing your columnist (White) 1-3 in a match to 5. For money this is nowhere near a double, White has too much work still to do, but the perceived wisdom at 4-away vs. 2-away is that one should double very aggressively, especially if there is any hint of a gammon in the air. Knowing this Peter doubled and naturally I accepted.
He then rolled one of his worst numbers, 42 and had to hit with 11/5*. I responded with 65 (luckily not 55!). I moved bar/20*/14* and the game and match were both soon over. Let us go back to the double. If Black rolls any 2 or 4 then he cannot point on White and White will have a lot of play as evidenced by the game continuation. But what if Black does point on White and White enters, which he is favourite to do?
Let us give Black a 61, played 11/5*, 6/5 and assume White enters with a 23, played bar/23, 11/8. What about this position? Black now has some very strong threats and although White has a take it is a much more uncomfortable one than in the in the original position. What if Black makes the 5-pt and White fans? Then the position is double and drop but only if Black still has access to the cube. If Black has already doubled, giving up his CFV then, of course, the game will continue, and White will win the game and the match nearly 20% of the time.
In the modern game players are much quicker to double than they were twenty or thirty years ago and, in the main, an aggressive strategy is likely to the correct one. However, you still need to give your opponent a difficult rather than a trivial decision. CFV is a very powerful concept and one that should be applied in many more situations than it is.
In the original position, because the gammon threat is small and because of CFV, Black does much better to hold on to the cube and in fact, by a small margin, XG rates doubling as a blunder.
Cube analysis 2-ply cubeless equity +0.153 0.593 0.025 0.002 - 0.407 0.058 0.001 Cubeful equities: 1. No double +0.298 2. Double, pass +1.000 (+0.702) 3. Double, take +0.077 (-0.221) Proper cube action: No double, take (23.9%)


--- type: formLayouts title: Child Form Element usage: Displays a from element has the child of another. stylesheet: '/scss/forms/form-child.scss' ---