I've generally assumed that the heavier stuff comes from JP whereas the more "melodic" stuff comes from JR. Not that heavy stuff can't be melodic, but you know what I mean. When I think of heavy in terms of guitar, it's crunchy power chords, driving riffs, that kind of thing, which we get a lot from with Dream Theater. When I think of heavy in terms of keyboards, I think Hammond with heavy percussion stops and screaming synths, and we really don't get a lot of that from DT, not these days. That was more of Derek's forte IMO.
So I guess that means we shouldn't assume that JP just writes the "guitar-based" parts and JR writes the "keyboard-based" stuff. I mean, JR could think of a guitar riff that he thinks would be great, and JP could come up with something he thinks would sound great on piano or other keys. Also, JR does play guitar. I don't know if JP plays keys, but they're both very talented musicians, so it wouldn't be a huge stretch to think that they both come up with music of all kinds, and they work it all into DT.
All that said, I still figure JP mostly "thinks" in terms of guitar and JR in terms of keys, and their collaborations meet in the middle somewhere, they work with it, and eventually what we get is a blend of many things from the both of them.